| jass |
Posted: Jan 01, 2009 02:25:06 AM |
Total Post: 41
Joined: Nov, 2008
|
whenever i run following code,error arise as shown below:
-------------------------------
variable v_d number(3)
declare
dep number(3);
begin
select max(deptno) into dep from dept;
:v_d:=dep;
end;
print v_d;
/
ERROR::
SP2-0552: Bind variable "V_D" not declared. |
|
|
chai |
| Posted: Jan 01, 2009 03:08:03 AM | |
|
Total Post: 319
Joined: Jul, 2008
|
With Bind variables:-
SQL> variable v_d number
SQL> declare
2 dep number(3);
3 begin
4 select max(deptno) into dep from dept;
5 :v_d:=dep;
6 end;
7 /
PL/SQL procedure successfully completed.
SQL> print v_d
V_D
----------
40
Without Bind variables:-
SQL> declare
2 dep number(3);
3 begin
4 select max(deptno) into dep from dept;
5 dbms_output.put_line(dep);
6 end;
7 /
40
PL/SQL procedure successfully completed.
|
|
|
|
|
chai |
| Posted: Jan 01, 2009 03:33:47 AM | |
|
Total Post: 319
Joined: Jul, 2008
|
Bind variables:-
http://infolab.stanford.edu/~ullman/fcdb/oracle/or-plsql.html
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |