🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#3849
From: Steve Kothenbeutel
Date: Thu, 06 Jun 2002 19:18
29 lines
2130 bytes
What happens when I have any number of arguments to pass?  This is my
problem.  For example... if the user sends 2 arguments back, I want to be
able to change the SQL... and if the user sends just one argument, then I
want to be able to change the SQL... see my point?

Thanks for the assitance!

"Clay Shannon" <cshannon@amfam.com> wrote in message
news:3cff9614$1_1@dnews...
> 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: <3cffb4e2_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!howland.erols.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews
References: <3cff342f_2@dnews> <3cff9614$1_1@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 12:35:39 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
References: <3cff342f_2@dnews> <3cff9614$1_1@dnews>
Subject: Re: Dynamic SQL - How do I create dynamic SQL statements on the fly?
Date: Thu, 6 Jun 2002 12:18:55 -0700
Lines: 31
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: <3cffb4e2_2@dnews>
X-Trace: dnews 1023390946 172.165.112.192 (6 Jun 2002 12:15:46 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!howland.erols.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews