🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Preparing querys..... but with select statements

#5648
From: David B. Held
Date: Mon, 26 Mar 2001 20:52
25 lines
1887 bytes
Jorge Leibowich wrote in message <3aa5134d_1@dnews>...
[snip]
>Query->SQL->Text="insert into qwe(field,zxc) values :asd,:zxc"
>Query->Prepare();
>for (...100000)
>{
>   Query->ParamByName("field")->AsInteger=i;
>   Query->ParamByName("zxc")->AsString="...";
>   Query->ExecSQL();
>}
>Query->UnPrepare();
>
>BUT... If a put the same replacing the text in "select from table where
>field = :field"
>and replacing Query->ExecSQL(); to Query->Open(); I do NOT get the correct
>RESULT. I'm Getting always the same result, and it is not correct. The
>QUESTION: The prepare method dont works in
>Query->Open() method? Only works in ExecSQL ???

Why exactly do you need to do 100000 SELECTs?  Why not open the
table directly, with a TTable object, and select a Range (if field is not
unique), or use GotoKey (if field is unique)?  Then you don't need to parse
the SQL 100,000 times or access the db 100,000 times.

Dave
Technical Details
Message-ID: <3ac0fce1$1_1@dnews>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!acadiau.ca!acadiau.ca!hub.org!hub.org!PeerFeed.KWeb.on.ca!dnews!12.27.41.66
References: <3aa5134d_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10bf25,724878896f80d4db
X-Google-Attributes: gid10bf25,public
X-Google-Thread: 10698b,724878896f80d4db
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-03-27 13:18:05 PST
From: "David B. Held" <dheld@codelogicconsulting.com>
Newsgroups: borland.public.cppbuilder.database.ado,borland.public.cppbuilder.database.desktop
References: <3aa5134d_1@dnews>
Subject: Re: Preparing querys..... but with select statements
Date: Mon, 26 Mar 2001 14:52:09 -0600
Lines: 28
Organization: CodeLogic, LLC
X-Newsreader: Microsoft Outlook Express 4.72.3155.0
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0
NNTP-Posting-Host: 12.27.41.66
Message-ID: <3ac0fce1$1_1@dnews>
X-Trace: 27 Mar 2001 12:49:37 -0800, 12.27.41.66
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!acadiau.ca!acadiau.ca!hub.org!hub.org!PeerFeed.KWeb.on.ca!dnews!12.27.41.66