Article View: borland.public.cppbuilder.database.ado
Article #3693Re: Faster way to just add a record
From: Kostya Taran
Date: Mon, 08 Jul 2002 08:31
Date: Mon, 08 Jul 2002 08:31
47 lines
2340 bytes
2340 bytes
try add this line: AdoDataSet->CursorLocation = clUseServer; "Georgi Cholakov" <georgi.cholakov@mail.bg> wrote: >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:
<3d294dfe$1_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!supernews.com!news.cs.utwente.nl!newshunter!cosy.sbg.ac.at!fu-berlin.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3d16bf57$1_1@dnews> <3d195aad_2@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-07-08 01:41:52 PST From: "Kostya Taran" <kostyat@hotmail.com> Sender: "Kostya Taran" <kostyat@hotmail.com> Reply-To: "Kostya Taran" <kostyat@hotmail.com> Subject: Re: Faster way to just add a record Newsgroups: borland.public.cppbuilder.database.ado X-User-Info: 213.200.33.74 213.200.33.74 References: <3d16bf57$1_1@dnews> <3d195aad_2@dnews> NNTP-Posting-Host: 207.105.83.65 Message-ID: <3d294dfe$1_1@dnews> Date: 8 Jul 2002 01:31:58 -0700 X-Trace: dnews 1026117118 207.105.83.65 (8 Jul 2002 01:31:58 -0700) Lines: 48 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!supernews.com!news.cs.utwente.nl!newshunter!cosy.sbg.ac.at!fu-berlin.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!dnews