Hi,
I am trying to retrieve data from an oracle database from an ASP page. I have a stored PRocedure on the Oracle db for this purpose. The stored procedure is as follows:
CREATE OR REPLACE PACKAGE employees_orcl
AS
TYPE empcur IS REF CURSOR;
PROCEDURE GetEmpRecords(p_cursor OUT empcur,indeptno IN NUMBER,inename IN varchar2);
END employees_orcl;
/
CREATE OR REPLACE PACKAGE BODY employees_orcl
AS
PROCEDURE GetEmpRecords(p_cursor OUT empcur,indeptno IN NUMBER,inename IN varchar2)
IS
BEGIN
OPEN p_cursor FOR SELECT * FROM emp WHERE deptid = indeptno and empname= inename;
END GetEmpRecords;
END employees_orcl;
/
My ASP page has code similar to this:
strConnection = "Provider=MSDAORA;Password
=rain;User
ID=rain;Data Source=a.world"
objConn.Open strConnection
objCmd.ActiveConnection = objConn
objCmd.CommandType = adCmdStoredProc
objCmd.CommandText= "employees_orcl.GetEmpReco
rds"
objCmd.Parameters.Append objCmd.CreateParameter("pa
ram2", adVarChar, adParamInput, 10, "100")
objCmd.Parameters.Append objCmd.CreateParameter("pa
ram3", adVarChar, adParamInput,10,"s")
Set objRs = objCmd.Execute
I am geting the following error:
Microsoft OLE DB Provider for Oracle error ''80040e14''
ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to ''GETEMPRECORDS'' ORA-06550: line 1, column 7: PL/SQL: Statement ignored
It works fine if i move the OUT parameter to the last position. Is there any specific way of passing arguments. Is there any workaround if i have the OUT parameter in the begining?
Any clue as to how to resolve this.
Thanks a lot
Soujanya
Start Free Trial