Re: Ampersand in PL/SQL

From: Spencer H Moore <Spencer.H.Moore_at_tek.com>
Date: 1995/04/14
Message-ID: <Spencer.H.Moore.39.2F8E9805_at_tek.com>#1/1


In article <D70Hpp.904_at_mail.auburn.edu> moorthy_at_eng.auburn.edu (Moorthy) writes:

You can make two changes to your code to reflect the fact that aaa is a PL/SQL variable while &aaa is a SQL*Plus substitution variable. You treated them as equivalents.

>declare
> zzz number(5);
> aaa number(5);
>begin
 aaa := &aaa /* <== Add this line. */
> select sal into zzz from emp where empno = &aaa; /* <== Change this line*/
 select sal into zzz from emp where empno = aaa; /* <== to this */
> if (zzz > 2000) then
> update emp set sal = zzz + 10 where empno = aaa;
> else
> update emp set sal = zzz + 500 where empno = aaa;
> end if;
> commit;
>end;
>/

Spencer Moore
ARIS Corporation Received on Fri Apr 14 1995 - 00:00:00 CEST

Original text of this message