🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#3842
From: Steve Kothenbeutel
Date: Thu, 06 Jun 2002 10:09
20 lines
1894 bytes
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: <3cff342f_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!cox.net!newspeer1-gui.server.ntli.net!ntli.net!newsfeed01.sul.t-online.de!t-online.de!dnews

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fcd2b,a8d67f18caa8caff,start
X-Google-Attributes: gidfcd2b,public
X-Google-Thread: 10698b,a8d67f18caa8caff,start
X-Google-Attributes: gid10698b,public
X-Google-Thread: f6386,a8d67f18caa8caff,start
X-Google-Attributes: gidf6386,public
X-Google-ArrivalTime: 2002-06-06 03:09:02 PST
From: "Steve Kothenbeutel" <skothenbeutel@consultant.com>
Newsgroups: borland.public.cppbuilder.database.ado,borland.public.cppbuilder.database.multi-tier,borland.public.delphi.database.multi-tier
Subject: Dynamic SQL - How do I create dynamic SQL statements on the fly?
Date: Thu, 6 Jun 2002 03:09:48 -0700
Lines: 23
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
NNTP-Posting-Host: 172.165.112.192
Message-ID: <3cff342f_2@dnews>
X-Trace: dnews 1023357999 172.165.112.192 (6 Jun 2002 03:06:39 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!cox.net!newspeer1-gui.server.ntli.net!ntli.net!newsfeed01.sul.t-online.de!t-online.de!dnews