Article View: borland.public.cppbuilder.database.multi-tier
Article #1338Multiple INSERT in one Query
From: Clayton M. Arends
Date: Sun, 21 Nov 1999 00:00
Date: Sun, 21 Nov 1999 00:00
22 lines
1450 bytes
1450 bytes
Hello all,
I am interested in writing a query that would insert data into multiple
records with one execute. I am currently doing the this using multiple
exec's and updating the parameters in a loop but for performance purposes I
wanted to see if it would be faster to execute all at once. The help for
BDE SQL says that INSERT "Adds one or more new rows of data in a table."
I've tried the following (and other variations) without success. I was
wondering if anyone out there knows of a way that this can be done:
query->SQL->Add("INSERT INTO SOMETABLE);
query->SQL->Add(" ( ID, PART )");
query->SQL->Add("VALUES ( (0, 0), (1, 1), (2, 2), (3, 3), (4, 4) )");
query->ExecSQL();
So the effect would be that SOMETABLE would contain five new records with ID
and PART initialized to 0 in the first record, 1 in the next, etc.
Any help would be appreciated, thank you,
- Clayton
Technical Details
Message-ID:
<819jse$f4e23@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcd2b,274144d6b95a47ea,start X-Google-Attributes: gidfcd2b,public From: "Clayton M. Arends" <carends@evisions.com> Subject: Multiple INSERT in one Query Date: 1999/11/21 Message-ID: <819jse$f4e23@forums.borland.com> X-Deja-AN: 551358580 X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.cppbuilder.database.multi-tier