Title: RE: reading variables

> -----Original Message-----
> From: Lance Prais [mailto:[EMAIL PROTECTED]]
>
> I am using toad.
>
> >If I use the following for to reference a variable in my code:
> >Update Primus_Temp_Dump set owner =(&test) where secure_id = Secure;
> >
> >I get this compile error:
> >PLS-00103: Encountered the symbol "&" when expecting one of
> the following:
> >
> >This is how you are supposed to reference variables in a SQL
> Statement?
> >
> >If I do this:
> >Update Primus_Temp_Dump set owner =('&test') where secure_id
> = Secure;
> >
> >I do not get the error but it passes &test into my query and it fails


What version of TOAD? I have 7.1 on my desktop, and I see the following in the help (searching for the word substitution):

<<Window: Variables
This window will come up if you specify parameters in your SQL query, from the SQL Edit window, such as:
select * from employee where employee_id = :empid
-OR-
select * from employee where employee_id = &empid
Once the variables window comes up, select each bound variable, select the data type, and enter the desired value.  Click OK to run the resulting SQL statement.

Note: Bound parameter substitution is NOT supported in anonymous PL/SQL blocks.>>

I experimented with the feature and it worked as advertised in the help.

Reply via email to