Problem calling function from ADO (PLS-00306)
Database version 8.1.7.0.0
Oracle Provider for OLE DB 8.1.7.2.0
I am getting error "PLS-00306 wrong number or types of arguments in call to 'GETSTAFFACCESSNUM' ORA-06550: line 1, column 7: PL/SQL: Statement ignored " when calling a function from ADO. The following is the function that I am calling:-
FUNCTION GetStaffAccessNum(v_staff_id IN VARCHAR2,
errorcode OUT NUMBER)
RETURN NUMBER IS
v_Access_Num STAFF.STAFF_ROLE_ACCESS_NUM%TYPE;
BEGIN
errorcode := 0;
SELECT NVL(STAFF_ROLE_ACCESS_NUM,0) INTO v_Access_Num FROM STAFF WHERE STAFF_ID = v_staff_id;
RETURN v_Access_Num;
EXCEPTION
WHEN OTHERS THEN
errorcode:= SQLCODE;
RETURN -1;
END GetStaffAccessNum;
The following is my VBScript code which causes generates the error
set oCmd = Server.CreateObject(ADODB.Command)
With oCmd
.ActiveConnection = ASPGetConnectionString()
.CommandType = adCmdText
.CommandText = "{? = CALL SamtypAccess.GetStaffAccessNum(?,?)}"
.Parameters.Append .CreateParameter("RET_VALUE", adInteger, adParamReturnValue)
.Parameters.Append .CreateParameter("STAFF_ID", adVarChar, adParamInput,20,"Test")
.Parameters.Append .CreateParameter("ERROR_CODE", adSmallInt, adParamOutput)
.Execute
ErrCode = .Parameters("ERROR_CODE")
if ErrCode <> 0 then
....
else
....
end if
End With
thanks for any assistance
Geraint Morgan