example:
var 1 varchar2(20)
exec :1 := 'abc';
That doesn't work, but this does...
var b1 varchar2(20)
exec :b1 := 'abc';
print b1
You have to work with the one out of the set of valid variable names
in sqlplus ... 1 is not legal.
Here is an example:
SQL> select * from marktest where fld2 = 1;
FLD1 FLD2 FLD3
---------- ---------- ---------
moe 1 24-AUG-10
SQL> @t98
SQL> set echo on
SQL> variable v1 varchar2(10)
SQL> variable v2 number
SQL> begin
2 :v2 := 1;
3 select fld1 into :v1 from marktest
4 where fld2 = :v2;
5 end;
6 /
PL/SQL procedure successfully completed.
SQL> print :v1
V1
--------------------------------
moe
HTH -- Mark D Powell --