🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: When to set Prepared = true

#4888
From: Matt Jacobs
Date: Sat, 25 Aug 2001 00:01
33 lines
1730 bytes
Thanks Mark. My main question is if I don't prepare it, can the SQL
still use parameters?

I guess my problem is I would like to avoid the round-trip to the
server for queries that are executed only once, with or without
parameters. If I have to create the parameters myself, that's fine.
But can I still use parameters, and will the VCL create them for me,
if the query is not prepared?

i.e.

TADOQuery *q= new TADOQuery(0);
q->Connection = TheConnection;
q->Close();
q->SQL->Clear();
q->SQL->Add("SELECT * FROM LAB_ORDER_DTLS WHERE LO_ID = :LO_ID");
q->Parameters->ParamByName("LO_ID")->Value = 10;
q->Open();

Or do I need to place a "q->Prepared = true" just before
ParamByName()?

Thanks again!

Matt



--

My reply-to address is purposely mangled to thwart auto-reply bots. 
Please remove the two leading underscores if you wish to reply via
e-mail.
Technical Details
Message-ID: <3b86e957.10717668@forums.inprise.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!howland.erols.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews
References: <3b85f5e5.1283054@forums.inprise.com> <3B863647.F5E35CC4@temporaldoorway.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,2c35ed6da94cb5e6
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-08-25 02:46:26 PST
From: mattja@ix.netcom.com (Matt Jacobs)
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Re: When to set Prepared = true
Date: Sat, 25 Aug 2001 00:01:51 GMT
Reply-To: __mattja@ix.netcom.com
Message-ID: <3b86e957.10717668@forums.inprise.com>
References: <3b85f5e5.1283054@forums.inprise.com> <3B863647.F5E35CC4@temporaldoorway.com>
X-Newsreader: Forte Free Agent 1.21/32.243
NNTP-Posting-Host: 24.9.166.132
X-Trace: dnews 998697648 24.9.166.132 (24 Aug 2001 17:00:48 -0700)
Lines: 33
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!howland.erols.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews