Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Decode inside cursor fails: PLS-00320
Why does the following cursor declaration fail?
DROP TABLE T1;
DROP TABLE T2;
CREATE TABLE T1 (A VARCHAR2(1));
CREATE TABLE T2 (A VARCHAR2(1));
DECLARE
CURSOR C IS
SELECT NULL FROM
( SELECT A
, DECODE(A,'X','0','1') "D" FROM T1) V1, T2 WHERE V1.A=T2.A;
The above gives the following error in SQL Plus:
( SELECT A
*
ERROR at line 4:
ORA-06550: line 4, column 9:
PLS-00320: the declaration of the type of this expression is incomplete or
malformed
When I comment the decode line, it works fine. If I don't use the cursor declaration, and just pass the select to the server, it works fine. If the select is not part of a joined view, it works fine.
This is a greatly simplified version of a big select, but it all works except the decode.
I sure hope somebody can give me an answer to this.
Thanks SO MUCH in advance.
Steve Cosner
-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Fri Mar 20 1998 - 00:00:00 CST