Wednesday, September 5, 2012

PL SQL: PLS-00382: expression is of wrong type

Cause:
 one of the cause is that implicit cursor is used as a variable

e.g:

-- wrong syntex
FOR x in ( select username from all_users)
LOOP
   dbms_output.put_line ( x);
END LOOP;

-- correct syntex
FOR x in ( select username from all_users)
LOOP
   dbms_output.put_line ( x.username);
END LOOP;

reference:
http://www.orafaq.com/forum/t/50755/2

No comments:

Post a Comment