Hi... I know this post is old, but maybe there's someone out there who can help me... I'm using stored procedures from Oracle for first time with asp.net and I have a problem related with this. Let's explain with some code. I have this package:
CREATE OR REPLACE PACKAGE myListPack
AS
TYPE
o_Cursor IS REF CURSOR;
PROCEDURE
miFirstListProc (
Parameter1
IN VARCHAR2,
Parameter2
IN VARCHAR2,
o_remCursor OUT o_Cursor);
[...]
And the body of the proc. -this is a very simple example- will look like this:
CREATE
OR REPLACE PACKAGE BODY myListPack AS
PROCEDURE myFirstListProc (
Parameter1
IN VARCHAR2,
Parameter2
IN VARCHAR2,
o_remCursor
OUT o_Cursor)
IS
BEGIN
OPEN
o_remCursor FOR SELECT * FROM myListTable;
END
myFirstListProc;
[...]
Allright. Then the code in my ASP.NET page (in VB.NET) is the next one:
Dim strConnectionString As String = "User Id=USER;Password=PASS;Data Source=DS;"
Dim oraconn As OracleConnection = New OracleConnection(strConnectionString)
oraconn.Open()
Dim oracmd As OracleCommand = New OracleCommand()
oracmd.Connection = oraconn
oracmd.CommandType = CommandType.StoredProcedure
oracmd.Parameters.Add("param1", OracleType.LongVarChar, 8).Value = Request.Params.Get("param1").ToString()
oracmd.Parameters.Add(
"param2", OracleType.LongVarChar, 8).Value = Request.Params.Get("param2").ToString()
'oracmd.Parameters.Add("o_Cursor", OracleType.Cursor, ParameterDirection.Output) <---------------------------- PEOPLE FROM FORUMS.ASP.NET!!!!! LOOK AT THIS!!!!
oracmd.CommandText =
"myListPack.myFirstListProc"Dim da As OracleDataAdapter = New OracleDataAdapter(oracmd)
Dim ds As DataSet = New DataSet()da.Fill(ds, "TABLENAME")
GridView1.DataSource = ds.Tables(
"TABLENAME")
Well, it's the same if I include the "o_Cursor" as an output parameter or I just comment that line as it is shown above, the error which I get when I launch the page is the same in both cases:
ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'MYFIRSTLISTPROC' ORA-06550: line 1, column 7: PL/SQL: Statement ignored
So the question is... where's the problem? which is the error with the parameter? If I take out the output parameter (from asp.net code and the package&procedure, without returning anything), there's no error, so the problem is with this cursor. CAN ANY BODY HELP ME, PLEASE??? Thanks a lot!!!!