🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #5769

Re: Faster, more faster

#5769
From: Yuancai (Charlie) Ye
Date: Thu, 08 Feb 2001 17:33
43 lines
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
>
>
Technical Details
Message-ID: <3a82d706_2@dnews>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!isdnet!howland.erols.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!208.21.4.213
References: <3a82cf9b_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,55eec9e591e30c55
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-02-08 09:36:33 PST
Reply-To: "Yuancai \(Charlie\) Ye" <yekerui@yahoo.com>
From: "Yuancai \(Charlie\) Ye" <yekerui@yahoo.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3a82cf9b_1@dnews>
Subject: Re: Faster, more faster
Date: Thu, 8 Feb 2001 12:33:33 -0500
Lines: 45
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 208.21.4.213
Message-ID: <3a82d706_2@dnews>
X-Trace: 8 Feb 2001 09:27:34 -0800, 208.21.4.213
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!isdnet!howland.erols.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!208.21.4.213