🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Dynamic SQL - How do I create dynamic SQL statements on the fly?

#3844
From: Dave Rowntree
Date: Thu, 06 Jun 2002 13:53
32 lines
2263 bytes
You will need to construct the SQL statement yourself in code to get the
flexibility you are looking for. Using parameters will not do the job.

--
Dave Rowntree
"Steve Kothenbeutel" <skothenbeutel@consultant.com> wrote in message
news:3cff342f_2@dnews...
> Hello,
>
> I am trying to create dynamic SQL statements that depend on user input.  I
> am aware of the Parameters property in TADOQuery for example... but I am
> unsure how to use it in the following scenario:
>
> A user sends a request for information as such:
>
> select :readfields from table1 where :conditions
>
> considering my ":readfields" and ":conditions", how do I use Parameters to
> fill in these fields when there are more than one field to substitute into
> each tag?  What if I had 3 fields I needed to plug into ":readfields".
How
> do I use Parameters to produce this sort of SQL statement?  And what if I
> want to use "OR" instead of "AND" in the statement between the field
names?
>
> Thanks in advance!
>
> Steve Kothenbeutel
> skothenbeutel@consultant.com
>
>
>
Technical Details
Message-ID: <3cff6803_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!newsfeed.online.be!bnewspeer00.bru.ops.eu.uu.net!emea.uu.net!skynet.be!skynet.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews
References: <3cff342f_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fcd2b,a8d67f18caa8caff
X-Google-Attributes: gidfcd2b,public
X-Google-Thread: 10698b,a8d67f18caa8caff
X-Google-Attributes: gid10698b,public
X-Google-Thread: f6386,a8d67f18caa8caff
X-Google-Attributes: gidf6386,public
X-Google-ArrivalTime: 2002-06-06 07:14:32 PST
From: "Dave Rowntree" <daver@brookswood.co.uk>
Newsgroups: borland.public.cppbuilder.database.ado,borland.public.cppbuilder.database.multi-tier,borland.public.delphi.database.multi-tier
References: <3cff342f_2@dnews>
Subject: Re: Dynamic SQL - How do I create dynamic SQL statements on the fly?
Date: Thu, 6 Jun 2002 14:53:15 +0100
Lines: 34
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 213.122.73.180
Message-ID: <3cff6803_2@dnews>
X-Trace: dnews 1023371267 213.122.73.180 (6 Jun 2002 06:47:47 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!newsfeed.online.be!bnewspeer00.bru.ops.eu.uu.net!emea.uu.net!skynet.be!skynet.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews