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
Response.Write(myReader[x] + " ");
}
Response.Write("
");
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!
sreelathapraveenPosted May 11, 2011, 11:20 AM
I can call my package from asp.net with MSDAORA provider.
But since the server went to 64 bit processor I can no longer use it, but only oledb.oracle. When I run the procedures and functions it works fine, but with packages I am getting the error
PLS-00201: identifier 'IO_CURSOR' must be declared
.Can anybody help me on this ?
Thanks in advance
CresenPosted Jul 5, 2010, 7:44 PM
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Data.OleDb;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
I hope you could help me on this...
Sam HobbsPosted Jul 5, 2010, 5:52 PM
If the errors are from C# (I doubt they are) then specify what references you have in your project for Oracle and show what "using" satements you have in your program for Oracle.