parameter in "in (:par)"

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
arconet
Posts: 5
Joined: Thu 19 Oct 2006 11:12

parameter in "in (:par)"

Post by arconet » Thu 01 Mar 2007 17:36

that type to put to the parameter "par1" in "in (: par1)"?

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 02 Mar 2007 14:38

Please describe the problem more detailed.

arconet
Posts: 5
Joined: Thu 19 Oct 2006 11:12

Post by arconet » Fri 02 Mar 2007 15:50

excuses, my English is very bad, i'm spanish.

my sentence is "Select * from table where campo in (val1, val2, ....)"

Since I can do this in tmartquery?

val1, val2, ... they are values to replace by parameters

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Sat 03 Mar 2007 08:49

You can use a macro. Set the SQL property of the TSmartQuery component to the following:

Code: Select all

SELECT * FROM table WHERE campo IN (&val)
The following code can be used to assign value to the macro:

Code: Select all

SmartQuery.MacroByName('VAL').Value := '''val1'', ''val2'', ''val3''';

arconet
Posts: 5
Joined: Thu 19 Oct 2006 11:12

Post by arconet » Wed 07 Mar 2007 17:51

ok, but if SQL property of the TSmartQuery is

Code: Select all

 select * from table where campo1=:par1  &opc1  &opc2
where opc1 is macro: "and campo2=:par2"
and opc2 is macro: "and campo3 IN (val1,val2,...)"

I can put in macro opc2: "and campo3 IN (&val)"?

thanks

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 12 Mar 2007 08:38

No, macros cannot be nested.

Post Reply