Bob,
This is just a guess, but looking at
http://www.mysql.com/doc/I/n/Insert_speed.html it appears that the way
to do multiple inserts looks like:
INSERT INTO a VALUES (1,23),(2,34),(4,33);
a(col1, col2).. Perhaps multiple inserts requires that you specify all
columns in the order that the table was defined? I suggest you try:
INSERT into book
values (
null, #booknum
'1-56592-434-7', #isbn
'MySQL & mSQL', #title
'Yarger', #authlname
'Randy Jay', #authfname
"O'Reilly", #publisher
null, #pubdate
null, #dewey
null, #lcnum
null, #checkin
null, #checkout
null #duedate
),
values(
null,
'0-312-25313-3',
'Coup de Grace',
'Borthwick',
'J S',
"St Martin's Minotaur",
null,
'813.54-dc21',
'PS3552.O756 C68 2000'
null,
null,
null
);
> -----Original Message-----
> From: Bob Rea [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 25, 2002 3:34 PM
> To: [EMAIL PROTECTED]
> Subject: Beginner needs help
>
>
> 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.
>
> 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