Thread View: borland.public.cppbuilder.database.ado
2 messages
2 total messages
Started by Jorge Leibowich
Thu, 08 Feb 2001 16:55
Faster, more faster
Author: Jorge Leibowich
Date: Thu, 08 Feb 2001 16:55
Date: Thu, 08 Feb 2001 16:55
8 lines
1158 bytes
1158 bytes
I need to know what is faster. I'm developing a program that it will run in a 486 (I need to optimize a lot). And I opening the table with TTable using ->Post. But a person (anatolix) said me that is faster to use an insert.with Prepare WHAT IS FASTER TO WRITE 50 ROWS: OPEN THE OBJECT AS TTABLE, OR A QUERY WITH ->Prepare ??? Help, and thanks
Re: Faster, more faster
Author: Yuancai (Charlie) Ye
Date: Thu, 08 Feb 2001 17:33
Date: Thu, 08 Feb 2001 17:33
43 lines
2932 bytes
2932 bytes
Hi,
If you have a few records to be inserted into a table, the speed
shouldn't be a problem. However, you may need to use a parameterized
statement to complete your job if you have a considerable number of records,
for example, 50,000 or more. Follow the below steps.
Step 1. First of all, you construct a statement with the charater '?'
like "insert into table orders values (?, ?, ?, ?, .....)".
Step 2. Create a command object in OLEDB programming, set a set of
parameters information data like data types (DBTYPE_I4, DBTYPE_STR, and so
on) and parameter type (input, output or input/output).
Step 3. Prepare a parameterized statement.
Step 4. Construct multiple sets of parameter data.
Step 5. Send multiple sets of parameter data into a data source with
a SINGLE call. For example, 75 sets of parameters data per call.
Additionally, you may start a manual transaction for increasing the
speed. It is also notified that there is no rowset involved here, and just a
command involved. If you can do the above steps, your insert speed should be
the best. For SQL Server, you can use the interface IRowsetFastLoad to
complete your job at the fatest speed. For this kind of work, see the
examples OLEDBExcel, FastLoad, MultiProcs at the site
http://www.geocities.com/oledbpro
However, I am not sure if you can follow the above steps to do bulk
inserts with Borland wrapper for ADO or ADO itself. Wish the idea and
examples are helpful to you!
Yuancai (Charlie) Ye
See 27 OLEDB examples at http://www.geocities.com/oledbpro
"Jorge Leibowich" <jorge@lid.com.ar> wrote in message
news:3a82cf9b_1@dnews...
> I need to know what is faster.
> I'm developing a program that it will run in a 486 (I need to optimize a
> lot). And I opening the table with TTable using ->Post. But a person
> (anatolix) said me that is faster to use an insert.with Prepare
>
> WHAT IS FASTER TO WRITE 50 ROWS: OPEN THE OBJECT AS TTABLE, OR A QUERY
> WITH ->Prepare ???
> Help, and thanks
>
>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads