If you don't have any error message, what make you think it doesn't
work?

FYI, I have run the following commands from mysql client:

mysql> use test
Database changed
mysql> create table Table1 (Id int not null auto_increment primary key,
Product varchar(80), Qty int);
Query OK, 0 rows affected (0.00 sec)

mysql> Insert Into Table1 (Product, Qty) Values ("56-56", 5),
("27-01", 1), ("15-02", 2);
Query OK, 3 rows affected (0.00 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql> select * from Table1;
+----+---------+------+
| Id | Product | Qty  |
+----+---------+------+
|  1 | 56-56   |    5 |
|  2 | 27-01   |    1 |
|  3 | 15-02   |    2 |
+----+---------+------+
3 rows in set (0.00 sec)

It really seems to work ;)

Regards,
Joseph Bueno

Ed Reed wrote:
> I created a new table called Table1 and did a test with that command. My
> test table does have all three fields that I mentioned. The ID field is
> an autoincrement. The other fieldnames match what's in my command. 
> 
> I'm running the command from MySQL-Front and it doesn't return any
> error message it just doesn't insert the new records. If I include the
> outer parens then it tells me there's an error in my syntax.
> 
> - Thanks
> 
> 
>>>>Joseph Bueno <[EMAIL PROTECTED]> 12/1/2002 12:00:21 PM >>>
> 
> According to your first post, your fields are named ID, PartNum, Qty.
> May be replacing 'Product' with 'PartNum' will help.
> You should only remove outer parens:
> 
> Insert Into Table1 (Product, Qty)
> Values ("56-56", 5), ("27-01", 1), ("15-02", 2);
> 
> If it does not work, you should also post the error message you
> are getting from mysql.
> 
> Regards,
> Joseph Bueno
> 
> Ed Reed wrote:
> 
>>Thanks for the response. I tried your example but it doesn't work,
>>Here's my SQL, can you tell what I'm doing wrong?
>>
>>Insert Into Table1 (Product, Qty)
>>Values (("56-56", 5), ("27-01", 1), ("15-02", 2));
>>
>>I've tried it with and without the outer parens.
>>
>>Thanks
>>
>>
>>
>>>>>"Adolfo Bello" <[EMAIL PROTECTED]> 12/1/2002 5:42:34 AM >>>
>>
>>INSERT INTO your_table(fields_list) VALUES
>>(record_1),(record_2),...,(record_n);
>>
>>
>>
>>>-----Original Message-----
>>>From: Ed Reed [mailto:[EMAIL PROTECTED]] 
>>>Sent: Saturday, November 30, 2002 3:47 PM
>>>To: [EMAIL PROTECTED] 
>>>Subject: Multiple Inserts and updates
>>>
>>>
>>>Can anyone give me an example of how to insert and/or update 
>>>multiple records in the same table simultaneously?
>>>
>>>I have a table with three fields; ID, PartNum, Qty. The user 
>>>enters PartNum and Qty data in an unbound grid UI. When the 
>>>user hits "Save" I'd like to build a single SQL statement 
>>
>>>from the data in the grid and have that one statement update 
>>
>>>or insert the rows in the table as necessary. I don't wanna 
>>>have to build a separate SQL statement for each row of the 
>>>grid (which is the only way I know how at this moment).
>>>
>>>Any help would be appreciated.
>>>
>>>
>>


---------------------------------------------------------------------
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