Help with CURSORS!!!
From: Michael Rosadino <mrosadino_at_snet.net>
Date: 1998/04/16
Message-ID: <6h5929$i5p_at_news2.snet.net>#1/1
PROCEDURE CURSOREX IS
BEGIN
DECLARE
vRevDivNm VARCHAR2(3);
CURSOR c IS SELECT REVENUE_DIVISION_NM FROM REVENUE_DIVISION; BEGIN
OPEN c;
LOOP
CLOSE c;
END;
END CURSOREX;
PLS-00201: identifier 'REF.REVENUE_DIVISION' must be declared PLS-00320: the declaration of the type of this expression is incomplete or malformed
Michael Rosadino,
Gerber Technology, Inc.
E-Mail: mrosadino_at_snet.net Received on Thu Apr 16 1998 - 00:00:00 CEST
Date: 1998/04/16
Message-ID: <6h5929$i5p_at_news2.snet.net>#1/1
/***************************************************************************
**************************/
PROCEDURE CURSOREX IS
BEGIN
DECLARE
vRevDivNm VARCHAR2(3);
CURSOR c IS SELECT REVENUE_DIVISION_NM FROM REVENUE_DIVISION; BEGIN
OPEN c;
LOOP
FETCH c INTO vRevDivNm; EXIT WHEN c%NOTFOUND; DBMS_OUTPUT.PUT_LINE('Division: '||vRevDivNm);END LOOP;
CLOSE c;
END;
END CURSOREX;
/***************************************************************************
**************************/
Compilation Errors:
PLS-00201: identifier 'REF.REVENUE_DIVISION' must be declared PLS-00320: the declaration of the type of this expression is incomplete or malformed
Now here's the strange part - when I execute this PL/SQL in SQL*Plus 3.3 as
an anonymous
block, i.e., from the DECLARE through the first END, it executes fine and
returns the
desired output. So why does it not compile as a stored procedure?
P.S. server = Oracle v.7.2.3 on an HP/UNIX 3000 platform; client = MS
Windows 95
Thanks in advance,
Michael Rosadino,
Gerber Technology, Inc.
E-Mail: mrosadino_at_snet.net Received on Thu Apr 16 1998 - 00:00:00 CEST