Re: Ampersand in PL/SQL

From: <James>
Date: 1995/04/18
Message-ID: <1995Apr18.124726.8524_at_newton.ccs.tuns.ca>#1/1


In article <3mltc3$n8i_at_solaris.cc.vt.edu> Thomas Dunbar <tdunbar_at_gserver.grads.vt.edu> writes:
>declare
> zzz number(5);
>begin
> select sal into zzz from emp where empno = &&aaa;
> 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;
>
>yes, that works ok..the first time..when called again, tho,
>it does not prompt for value but reuses what was given before!
>

I tried it, and it doesn't prompt for the 2nd & 3rd &variables. My guess is that the "&&" does a permanent assignment (for the session) of the variable and the "&" just accesses the variable.

If they were all single "&", you would be prompted each time.

James Richard (JRICHARD_at_TUNS.CA)
"No Assembler Required!" Received on Tue Apr 18 1995 - 00:00:00 CEST

Original text of this message