🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Faster way to just add a record

#3709
From: Georgi Cholakov
Date: Wed, 26 Jun 2002 06:07
35 lines
2167 bytes
Hi, Christian
I saw the recommended tricks, but in my modest opinion they are useless or
difficult to use. I think the reason for delay is in your SELECT statement,
because you first select all the data from the table Customer and then
insert a new record. If you optimize your select to return a small number of
records the delay will be minimized.
Try this: "SELECT * FROM CUSTOMER WHERE CUST_ID = 0" for example, where
CUST_ID is the name of the primary key. This statement will return no
records and it will be fastest & simplest way for your case.

Georgi Cholakov

"Christian Schneider" <csname@hotmail.com> wrote in message
news:3d16bf57$1_1@dnews...
>
> I just want to add a record to a table. I am now
> using something like this:
>
> AdoDataSet->CommandText = "SELECT * FROM Customer";
> AdoDataSet->Open();
> AdoDataSet->Insert();
> AdoDataSet->FieldByName(...) = ...
> AdoDataSet->Post();
> AdoDataSet->Close();
>
> The problem is, that Open() can take very long if the
> table is large. It would be much faster to use an
> "INSERT INTO"-Statement, but I can't use it because
> my record contains BLOB-Fields.
>
> It there really no other way to just add
> a record to a table without waiting several seconds?
>
>
> Christian Schneider
Technical Details
Message-ID: <3d195aad_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!news3.cnt.ru!srcc!newsfeed.gamma.ru!Gamma.RU!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews
References: <3d16bf57$1_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,245e9e27193aa62b
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-06-25 23:34:41 PST
From: "Georgi Cholakov" <georgi.cholakov@mail.bg>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3d16bf57$1_1@dnews>
Subject: Re: Faster way to just add a record
Date: Wed, 26 Jun 2002 09:07:32 +0300
Lines: 39
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2532.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2532.0000
NNTP-Posting-Host: 80.72.72.177
Message-ID: <3d195aad_2@dnews>
X-Trace: dnews 1025071789 80.72.72.177 (25 Jun 2002 23:09:49 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!news3.cnt.ru!srcc!newsfeed.gamma.ru!Gamma.RU!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews