Page 1 of 1
parameter in "in (:par)"
Posted: Thu 01 Mar 2007 17:36
by arconet
that type to put to the parameter "par1" in "in (: par1)"?
Posted: Fri 02 Mar 2007 14:38
by Plash
Please describe the problem more detailed.
Posted: Fri 02 Mar 2007 15:50
by arconet
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
Posted: Sat 03 Mar 2007 08:49
by Plash
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''';
Posted: Wed 07 Mar 2007 17:51
by arconet
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
Posted: Mon 12 Mar 2007 08:38
by Plash
No, macros cannot be nested.