Home » SQL & PL/SQL » SQL & PL/SQL » PLS-00382: expression is of wrong type
PLS-00382: expression is of wrong type [message #134002] Tue, 23 August 2005 03:46 Go to next message
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 Go to previous messageGo to next message
mchadder
Messages: 224
Registered: May 2005
Location: UK
Senior Member
Hello.

It's because of :
lvn := x ;

Since x is your cursor variable, not a number. Presumably, you are trying to output the value of QUENBR? If so, then use :
lvn := x.quenbr;

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
Re: PLS-00382: expression is of wrong type [message #134010 is a reply to message #134007] Tue, 23 August 2005 04:47 Go to previous message
b_chugh
Messages: 68
Registered: August 2005
Location: delhi
Member
Thanks alot
Previous Topic: I have problem while sending mail
Next Topic: Creating XML files with XMLDom
Goto Forum:
  


Current Time: Sun Nov 24 16:32:22 CST 2024