3 messages in com.mysql.lists.mysqlRe: Compound Insert Statement
FromSent OnAttachments
Rich29 Mar 2006 20:15 
sheeri kritzer29 Mar 2006 21:40 
SGr...@unimin.com30 Mar 2006 06:54 
Subject:Re: Compound Insert Statement
From:sheeri kritzer (awf@gmail.com)
Date:03/29/2006 09:40:38 PM
List:com.mysql.lists.mysql

That is, in fact, the exact correct syntax. What error are you getting when you try to run that on the commandline? What version of MySQL are you using?

-Sheeri

On 3/29/06, Rich <lis@viaduct-productions.com> wrote:

Hi folks. I come to the list with another compound question.

My middleware allows me to build any syntax for the actual sql statement, so I'm trying to minimize the work done to insert several records at one try. I currently have multiple insert statements, but can't find any reference to multiple records added using one insert statement. I now have:

-SQL = "INSERT INTO mytable (myfield) VALUES ('alpha');INSERT INTO mytable (myfield) VALUES ('bravo');INSERT INTO mytable (myfield) VALUES ('charlie');INSERT INTO mytable (myfield) VALUES ('delta');"

What I would like to find is this:

-SQL = "INSERT INTO mytable (myfield) VALUES ('alpha'), ('bravo'), ('charlie'), ('delta')";

I am either looking in the wrong place in Dubois (Third) or it can't be done.

Any recommendations?

Appreciate it.

Cheers