Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 04-02-2004, 08:44 AM   #1
Member (10 bit)
 
GSXdan's Avatar
 
Join Date: Jun 2002
Location: P-burg, Ohio, USA
Posts: 555
Send a message via AIM to GSXdan
multiple insert statements(SQL)....?

Is there a way to insert multiple values in one INSERT statement?

For example:
Code:
INSERT INTO 'phonebook' ('id', 'fname', 'lname')
VALUES ('1', 'dan', 'smith')
VALUES ('2', 'joe', 'smith');
.....
^^^i know that is not correct syntax, but is there a way to do that? I keep getting errors no matter what way i try it.

TIA ^dan
GSXdan is offline   Reply With Quote
Old 04-02-2004, 08:53 AM   #2
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
No, you will need a seperate insert statement for each record you want to insert in that way. Insert statements can only add more than one record using SELECT statements, like INSERT INTO phonebook (ID, FNAME, LNAME) SELECT ID, FNAME, LNAME FROM another_table
doctorgonzo is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:51 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2