PLS-00305: previous use of OPENTOP10CV(at line nn) conflicts with this use
450198Aug 15 2005 — edited Aug 15 2005Hi everyone,
I am a novice user of PL/SQL, so please bear with me. While trying to store the package body I am getting the following error :
Line 16, Column 1
PLS-00305: previous use of OPENTOP10CV(at line nn) conflicts with this use
and here are my package spec. and package body:
CREATE OR REPLACE PACKAGE CV_TYPES
AS
Type Top10CurTyp IS REF CURSOR;
MyField Varchar2(140);
MyCount NUMBER(22,12);
PROCEDURE OPENTOP10CV(top10CV IN OUT Top10CurTyp, Choice INT);
End;
CREATE OR REPLACE PACKAGE BODY CV_TYPES
AS
/*
FUNCTION FUNCTION_NAME( PARAMETERS )
RETURN DATATYPE;
IS
RETURN_VARIABLE DATATYPE;
BEGIN
END;
PROCEDURE PROCEDURE_NAME( PARAMETERS );
AS
BEGIN
END;
*/
PROCEDURE OPENTOP10CV(top10CV IN OUT Top10CurTyp, Choice INT);
sql_stmt VARCHAR2(200);
BEGIN
CASE Choice
WHEN 1 THEN
sql_stmt := 'Select * from (Select NVL(Product_Type, "Unknown") Exp, SUM(COUNT) COUNT FROM incidents_Summary Group by Product_Type ORDER BY COUNT DESC) Where ROWNUM < = 10';
WHEN 2 THEN
sql_stmt := 'Select * from (Select NVL(Problem_Type, "Unknown") Exp, SUM(COUNT) COUNT FROM incidents_Summary Group by Problem_Type ORDER BY COUNT DESC) Where ROWNUM < = 10';
WHEN 3 THEN
sql_stmt := 'Select * from (Select NVL(Solution, "Unknown") Exp, SUM(COUNT) COUNT FROM incidents_Summary Group by Solution ORDER BY COUNT DESC) Where ROWNUM < = 10';
WHEN 4 THEN
sql_stmt := 'Select * from (Select NVL(Reason_Code, "Unknown") Exp, SUM(COUNT) COUNT FROM incidents_Summary Group by Reason_Code ORDER BY COUNT DESC) Where ROWNUM < = 10';
END CASE;
OPEN top10CV FOR sql_stmt;
RETURN top10CV;
END CV_TYPES;
Please help as soon as possible.
Thanks