Home » SQL & PL/SQL » SQL & PL/SQL » reference a variable
reference a variable [message #36999] Wed, 09 January 2002 12:43 Go to next message
Lance Pris
Messages: 40
Registered: January 2002
Member
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

Please help
Re: reference a variable [message #37010 is a reply to message #36999] Thu, 10 January 2002 01:18 Go to previous message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
Hi,
Try this:
--------
declare
test varchar2(50):='&owner';
n number;
begin
Update Primus_Temp_Dump set owner =test where secure_id = Secure;
end;
----------

cheers
pratap
Previous Topic: define please
Next Topic: setting line lengths
Goto Forum:
  


Current Time: Sat Apr 20 06:43:59 CDT 2024