Leigh Warren
|
| Posted: 07/29/2002, 7:34 AM |
|
Hi,
Can someone tell me if I can put multiple SQL lines into one INSERT query?
Cheers,
Leigh..
|
|
|
 |
DonB
|
| Posted: 07/29/2002, 9:17 PM |
|
If you mean "insert multiple rows into a table with one INSERT", then no -
not really.
If you mean "several INSERTs in one command. then no (unless your database
supports stored procedures, in which you could define several INSERTS.
Basically, you can issue one "command" to the database at a time, be that
one INSERT or one "execute a store procedure" statement.
I'm guessing you want one "click" on a submit button to insert several
things into a database. If you are not concerned with data integrity, you
could modify the click event (or the insert event) to execute several
commands on the active database connection (e.g., connection1.Execute
(onething) followed by another line of script that does connection1.Execute
(another thing). This is permitted, but bad technique (suppose only one of
the Executes succeeds?).
I'd opt for the stored procedure, which may not be an option for you -
depending on the database engine you are using.
"Leigh Warren" <leigh.warren@arkgeo.com> wrote in message
news:ai3jqh$6h0$1@news.codecharge.com...
> Hi,
>
> Can someone tell me if I can put multiple SQL lines into one INSERT query?
>
> Cheers,
>
> Leigh..
>
>
|
|
|
 |
|