At 15:33 -0800 2/25/02, Bob Rea wrote:
>I'm getting a syntax error when I try to insert more two
>sets of values into a table.
>
>I have looked at the manual on the insert statement, and
>don't see what is wrong.

The error message indicates that the problem is at the word "values".
The problem with your syntax is that "values should occur only once:

INSERT INTO tbl_name (column list) VALUES (list of values), (list of values);

>
>Can someone tell me.
>
>Here's the info.
>mysql> describe book;
>+-----------+-------------+------+-----+---------+----------------+
>| Field     | Type        | Null | Key | Default | Extra   
>       |
>+-----------+-------------+------+-----+---------+----------------+
>| booknum   | int(20)     |      | PRI | NULL    |
>auto_increment |
>| isbn      | varchar(14) | YES  |     | NULL    |         
>       |
>| title     | varchar(50) | YES  |     | NULL    |         
>       |
>| authlname | varchar(20) | YES  |     | NULL    |         
>       |
>| authfname | varchar(20) | YES  |     | NULL    |         
>       |
>| publisher | varchar(20) | YES  |     | NULL    |         
>       |
>| pubdate   | date        | YES  |     | NULL    |         
>       |
>| dewey     | varchar(20) | YES  |     | NULL    |         
>       |
>| lcnum     | varchar(20) | YES  |     | NULL    |         
>       |
>| checkin   | date        | YES  |     | NULL    |         
>       |
>| checkout  | date        | YES  |     | NULL    |         
>       |
>| duedate   | date        | YES  |     | NULL    |         
>       |
>+-----------+-------------+------+-----+---------+----------------+
>12 rows in set (0.00 sec)
>
>Here's the attempt:
>mysql> INSERT into book(
>     -> isbn,
>     -> title,
>     -> authlname,
>     -> authfname,
>     -> publisher,
>     -> pubdate,
>     -> dewey,
>     -> lcnum
>     -> )
>     -> values (
>     -> '1-56592-434-7',
>     -> 'MySQL & mSQL',
>     -> 'Yarger',
>     -> 'Randy Jay',
>     -> "O'Reilly",
>     -> null,
>     -> null,
>     -> null
>     -> ),
>     -> values(
>     -> '0-312-25313-3',
>     -> 'Coup de Grace',
>     -> 'Borthwick',
>     -> 'J S',
>     -> "St Martin's Minotaur",
>     -> null,
>     -> '813.54-dc21',
>     -> 'PS3552.O756 C68 2000'
>     -> );
>ERROR 1064: You have an error in your SQL syntax near
>'values(
>'0-312-25313-3',
>'Coup de Grace',
>'Borthwick',
>'J S',
>"St Martin's Minot' at line 21
>
>TIA
>
>--
>Bob Rea
>
>**************************************************
>    "On the side of the box, under 'System
>     Requirements', it said 'Requires Windows
>     95 or better'. So I installed Linux."
>**************************************************
>
>[EMAIL PROTECTED]  http://home.earthlink.net/~sfpetard/
>
>---------------------------------------------------------------------
>Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
>To request this thread, e-mail <[EMAIL PROTECTED]>
>To unsubscribe, e-mail <[EMAIL PROTECTED]>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to