Cresen

Cresen

  • NA
  • 6
  • 0

identifier 'IO_CURSOR' must be declared

Jul 5 2010 6:37 AM
I badly need a help on this.

Database: Oracle 10g
Language used: ASP.Net 3.5 using C# language

Step 1: I created a Package in the Oracle Database Server

CREATE OR REPLACE PACKAGE eqpdaily_package AS
     TYPE t_cursor IS REF CURSOR ;
     Procedure open_join_cursor1 (n_EMPNO IN VARCHAR2, io_cursor IN OUT t_cursor);
   END eqpdaily_package;

Step 2: I created the package body
CREATE OR REPLACE PACKAGE BODY eqpdaily_package AS
   Procedure open_join_cursor1 (n_EMPNO IN varchar2, io_cursor IN OUT t_cursor)
   IS
     v_cursor t_cursor;
   BEGIN
    
       OPEN v_cursor FOR
       SELECT EQPTMON.DATEMON, EQPTMON.SHIFTCODE, EQPTMON.EMPONDUTY
         FROM EQPTMON
         WHERE EQPTMON.EMPONDUTY = n_EMPNO;

   io_cursor := v_cursor;
   END open_join_cursor1;
   END eqpdaily_package;

Step 3:  I tried to get the results from my ASP.Net Page using the C# language.

OleDbCommand myCMD = new OleDbCommand ("{call eqpdaily_package.open_join_cursor1(?, {resultset 0, io_cursor})}", con);
        myCMD.Parameters.Add("n_EMPNO", OleDbType.VarChar, 10).Value = "66364-0";

        
        OleDbDataReader myReader = myCMD.ExecuteReader();

        int x, count;

        count = 0;
     
        while (myReader.Read())
        {
            for (x = 0; x<myReader.FieldCount - 1; x++)
            {
                Response.Write(myReader[x] + " ");
            }
            Response.Write("<br>");
            count += 1;
        }

        myReader.Close();


Here is the ERROR:

ORA-06550: line 1, column 45:
PLS-00201: identifier 'IO_CURSOR' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored


--->  What should I do in order to eliminate the above error?  I already got headaches on this problem... Please help!


Answers (3)