Toad World® Forums

Setting variables in a query

Hi,

I just installed TOAD data point on my new laptop and can’t figure out how/where to set bind variable (using Oracle database). I had it setup such that if I ran a query with a variable, a window will popup and I can leave the values for the variables as I had them previsously or change to a new value. I just can’t figure out where that setting is anymore. Here is an example of how my queries were before:

select * from table1 where field1 = &&myVar;

a window used to popup when I tried to run this query asking me to put in value for “myVar”. I can’t seem to find that setting anymore. Any help is much appreciated

Try to use colon instead of ampersands like in the following example

select * from table1 where field1 = :myVar;

Thanks

Aleksey

thank you… that seems to work partially. If I have just one value then it works but if I have an “in” statement then it doesn’t like it… example:

select * from table1 where field1 in (&&myVar);

used to allow me to provide value for myVar as 1,3,4 and then it would execute following query as a result:

select * from table1 where field1 in (1,3,4);

I can’t provide more than one value with the colon as the prefix to my variable

Using && as a variable in such way is Oracle Sql Plus feature and Toad for Oracle supports it.

I am not sure that Toad Data Point ever supports it. But let me re-check it.

Thanks

Aleksey

You are right.

TDP used to support such variable replacement but this feature was removed because it caused compatibility issue. Now we are going to release a patch and rollback this feature.

If you like to have the patch please e-mail to Debbie.Peabody@quest.com directly and request it.

Thanks

Aleksey