🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to assign parameter for SQL( select * from Suppliers where SuppID in( '111','222','333')

#3871
From: M. Noroozi Eghbali
Date: Mon, 10 Jun 2002 12:30
37 lines
1855 bytes
Sorry, this is another example for "Select" command:


 ADOQuery1->SQL->Clear();

 ADOQuery1->SQL->Add("SELECT * FROM Cars where MD_Name in (:S, :Q, :L)");
  ADOQuery1->Parameters->ParamByName("S")->Value = "Car 1";
  ADOQuery1->Parameters->ParamByName("Q")->Value = "Car 2";
  ADOQuery1->Parameters->ParamByName("L")->Value = "Car 3";

 ADOQuery1->ExecSQL();

You must use more than one parameter.

Regards,
Mehrdad


"Junlin Xie" <jlxie@yahoo.com> wrote in message news:3d04779b_2@dnews...
> Hi,
>     I want to query data from using ADODataSet, the SQL as following:
>
>     Select * from Suppliers where SuppID in (:SuppList),
>
>     Supplist = "'111', '222', '333'";
>     I set ADODataSet->Parameters->ParamByName("SuppList")->Value =
Supplist;
>
>     But It does not work, How to set parameters for the kind of SQL
> statement?
>
>     Thank you very much!
>
> Junlin Xie
>
>
>
Technical Details
Message-ID: <3d049bb3_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-08!supernews.com!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews
References: <3d04779b_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,c794c3e7eac6ad87
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-06-10 05:38:14 PST
From: "M. Noroozi Eghbali" <galaxy@irandoc.ac.ir>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3d04779b_2@dnews>
Subject: Re: How to assign parameter for SQL( select * from Suppliers where SuppID in( '111','222','333')
Date: Mon, 10 Jun 2002 17:00:33 +0430
Lines: 39
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.176.21.5
Message-ID: <3d049bb3_1@dnews>
X-Trace: dnews 1023712179 213.176.21.5 (10 Jun 2002 05:29:39 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-08!supernews.com!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews