PLS-00382: expression is of wrong type [message #134002] |
Tue, 23 August 2005 03:46 |
b_chugh
Messages: 68 Registered: August 2005 Location: delhi
|
Member |
|
|
CREATE OR REPLACE PROCEDURE Proc_Temp IS
v_message VARCHAR2(100);
lvn NUMBER(22);
BEGIN
for x in (select QUENBR from QUE)
loop
lvn := x ;
dbms_output.PUT_LINE(lvnx);
end loop;
EXCEPTION
WHEN OTHERS THEN
v_message:='This is an exception ';
END;
/
PLS-00382: expression is of wrong type
please help me why is this error coming.
|
|
|
Re: PLS-00382: expression is of wrong type [message #134007 is a reply to message #134002] |
Tue, 23 August 2005 04:39 |
mchadder
Messages: 224 Registered: May 2005 Location: UK
|
Senior Member |
|
|
Hello.
It's because of :
Since x is your cursor variable, not a number. Presumably, you are trying to output the value of QUENBR? If so, then use :
i.e.
SQL> CREATE OR REPLACE PROCEDURE Proc_Temp IS
2 v_message VARCHAR2(100);
3 lvn NUMBER(22);
4 BEGIN
5 for x in (select QUENBR from QUE)
6 loop
7 lvn := x.quenbr ;
8 dbms_output.PUT_LINE(lvn);
9 end loop;
10 EXCEPTION
11 WHEN OTHERS THEN
12 v_message:='This is an exception ';
13 END;
14 /
Procedure created.
Rgds
|
|
|
|