🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#3847
From: Clay Shannon
Date: Thu, 06 Jun 2002 17:04
17 lines
1664 bytes
Use the Format function, zB:

Format('Select %s, %s FROM %s where %s = %s',
  [arg1, arg2, arg3, arg4]);

"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
>
Technical Details
Message-ID: <3cff9614$1_1@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
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 10:10:32 PST
From: "Clay Shannon" <cshannon@amfam.com>
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 12:04:21 -0500
Lines: 19
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 165.200.80.151
Message-ID: <3cff9614$1_1@dnews>
X-Trace: dnews 1023383060 165.200.80.151 (6 Jun 2002 10:04:20 -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