SP2-0552: Bind variable "V_D" not declared. [message #628509] |
Tue, 25 November 2014 22:34 |
|
mist598
Messages: 1195 Registered: February 2013 Location: Hyderabad
|
Senior Member |
|
|
Hi all,
SQL> var v_d date;
Usage: VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) |
VARCHAR2 (n [CHAR|BYTE]) | NCHAR | NCHAR (n) |
NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR |
BINARY_FLOAT | BINARY_DOUBLE ] ]
SQL> begin
2 select Ordered_Date(sysdate) into :v_d from dual;
3 end;
4 /
SP2-0552: Bind variable "V_D" not declared.
How to execute this function in SQL*PLUS
|
|
|
|
|
|
|
Re: SP2-0552: Bind variable "V_D" not declared. [message #628514 is a reply to message #628512] |
Tue, 25 November 2014 22:58 |
|
mist598
Messages: 1195 Registered: February 2013 Location: Hyderabad
|
Senior Member |
|
|
SQL> DECLARE
2 v_date date;
3 BEGIN
4 v_date := Ordered_Date(sysdate);
5 dbms_output.put_line('Today Date is : ' || v_date);
6 END;
7 /
Today Date is : 23-DEC-10
PL/SQL procedure successfully completed.
SQL> exec DBMS_OUTPUT.PUT_LINE (Ordered_Date(sysdate))
23-DEC-10
PL/SQL procedure successfully completed.
It is fine when i calling like above code, but when i am calling using select statement i am getting Error SP2-0552: Bind variable "V_D" not declared.
[Updated on: Tue, 25 November 2014 22:58] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
Re: SP2-0552: Bind variable "V_D" not declared. [message #628529 is a reply to message #628522] |
Wed, 26 November 2014 01:16 |
|
Michel Cadot
Messages: 68732 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Did you read what SQL*Plus told you?
SQL> var v_d date;
Usage: VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) |
VARCHAR2 (n [CHAR|BYTE]) | NCHAR | NCHAR (n) |
NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR |
If the declaration fails then the variable is not declared, is this not obvious?
|
|
|