🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Fastest Way to Insert a Number of Records via SQL

#218
From: DeanB
Date: Fri, 22 Jun 2007 18:48
51 lines
3050 bytes
On Jun 22, 2:43 pm, DeanB <deanbrow...@yahoo.com> wrote:
> On Jun 8, 4:53 pm, Dan <D...@do.not.spam> wrote:
>
>
>
>
>
> > I'm still not at copy and paste speeds but was able to decrease insert
> > times by over 80%.
>
> > I started with this:
>
> > TADOQuery *SQLObject = (pointer of actual object);
> > do
> > {
> >    SQLObject->SQL->Text = "Insert into [tablename] (fields...) VALUES
> > (values..)";}
>
> > while (still have to import huge number of records);
> > SQLObject->ExecSQL();
>
> > To increase I changed the above to something like this:
> > TADOQuery *SQLObject = (pointer of actual object);
> > SQLObject->SQL->Text = "Select (field) from [tablename] where (field
> > doesn't already exist); //fast query to turn on SQL
> > do
> > {
> >    SQLObject->InsertRecords(ARRAYOFCONST((fieldvalues...)));}
>
> > while (still have to import huge number of records);
> > SQLObject->BatchUpdate(arAll);
>
> > Any other suggestions on how to increase speed?  I am presently at
> > around 200ms for 520 records, and I'd like to be well less than 100ms
>
> > Dan
>
> Hey Dan,
>
> What's this line:
>
> SQLObject->InsertRecords(ARRAYOFCONST((fieldvalues...)));
>
> I don't see InsertRecords as a function in TADO components. I see an
> InsertRecord function, note that's singular event.
>
> -Dean- Hide quoted text -
>
> - Show quoted text -

Note I am using CBuilder-6, maybe you are using a more recent version?
Technical Details
Message-ID: <1182538104.428496.73990@x35g2000prf.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!x35g2000prf.googlegroups.com!not-for-mail
References: <46645ac3@newsgroups.borland.com> <466477c6$1@newsgroups.borland.com> <466580d1@newsgroups.borland.com> <4665925c@newsgroups.borland.com> <46659f88@newsgroups.borland.com> <4666194d@newsgroups.borland.com> <46665d06@newsgroups.borland.com> <4669c1e0$1@newsgroups.borland.com> <1182537800.146406.36130@i13g2000prf.googlegroups.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,d0a6c05550b4cac9
X-Google-Attributes: gid10698b,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!x35g2000prf.googlegroups.com!not-for-mail
From:  DeanB <deanbrown3d@yahoo.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Re: Fastest Way to Insert a Number of Records via SQL
Date: Fri, 22 Jun 2007 18:48:24 -0000
Organization: http://groups.google.com
Lines: 52
Message-ID: <1182538104.428496.73990@x35g2000prf.googlegroups.com>
References: <46645ac3@newsgroups.borland.com>
   <466477c6$1@newsgroups.borland.com>
   <466580d1@newsgroups.borland.com>
   <4665925c@newsgroups.borland.com>
   <46659f88@newsgroups.borland.com>
   <4666194d@newsgroups.borland.com>
   <46665d06@newsgroups.borland.com>
   <4669c1e0$1@newsgroups.borland.com>
   <1182537800.146406.36130@i13g2000prf.googlegroups.com>
NNTP-Posting-Host: 151.204.192.233
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Trace: posting.google.com 1182538105 20085 127.0.0.1 (22 Jun 2007 18:48:25 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 22 Jun 2007 18:48:25 +0000 (UTC)
In-Reply-To: <1182537800.146406.36130@i13g2000prf.googlegroups.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: x35g2000prf.googlegroups.com; posting-host=151.204.192.233;
   posting-account=Cef3nA0AAACwumsbf6m0Ses922aBOB8w