MS Oracle .NET Provider and REF CURSOR Error

  • Thread starter Krams \( Change shift2 to @ \)
  • Start date
K

Krams \( Change shift2 to @ \)

Hi,
When I call a Oracle Packaged procedure that has a IN OUT REF cursor
parameter, I get he followign error. There is data in the database
corresponding to the input params.
I have seen some posts about this but none of htem have helped me with this
error. This is not happening intermittently s some claim but consistently.

Thanks
Krams

PROCEDURE TSP_BUILDACL
(
USERID IN TOT_TSPEXCEPTIONS.TSE_EMPLOYEEID%TYPE,
DIVISION IN SEC_JOBCODEROLES.SJR_DIVISION%TYPE,
JOBCODE IN SEC_JOBCODEROLES.SJR_JOBCODE%TYPE,
LOCATIONLEVEL IN TOT_TSPEXCEPTIONS.TSE_LOCATIONLEVEL%TYPE,
LOCATIONID IN TOT_TSPEXCEPTIONS.TSE_LOCATIONID%TYPE,
ACLCURSOR IN OUT T_CURSOR
)
IS
V_LOCATIONLEVEL TOT_TSPEXCEPTIONS.TSE_LOCATIONLEVEL%TYPE;
V_LOCATIONID TOT_TSPEXCEPTIONS.TSE_LOCATIONID%TYPE;
V_ROLEID TOT_TSPEXCEPTIONS.TSE_ROLEID%TYPE;
V_ACLCURSOR T_CURSOR ;
BEGIN

SELECT TSE_LOCATIONLEVEL, TSE_LOCATIONID, TSE_ROLEID INTO
V_LOCATIONLEVEL, V_LOCATIONID, V_ROLEID
FROM TOT_TSPEXCEPTIONS
WHERE LOWER(TSE_EMPLOYEEID) = LOWER(TSP_ACLPACKAGE.TSP_BUILDACL.USERID)
AND TSE_EXCEPTIONTYPE = 'R' AND ROWNUM = 1;
--If there is more than one row in the database matching the USERID and
EXCEPTIONTYPE
--then this fetch will cause an exception to be raised because multiple
values cannot
--be inserted into a single variable.
--The ROWNUM condition above ensures only the first row gets picked up.
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
--Default the Location ID to the input location
V_LOCATIONID := TSP_ACLPACKAGE.TSP_BUILDACL.LOCATIONID;
V_ROLEID := NULL;
V_LOCATIONLEVEL := NULL;
END ;

--Identify the Role
IF V_ROLEID IS NULL THEN
BEGIN
SELECT SJR_ROLEID INTO V_ROLEID
FROM SEC_JOBCODEROLES
WHERE SJR_JOBCODE = TSP_ACLPACKAGE.TSP_BUILDACL.JOBCODE
AND ( SJR_DIVISION = TSP_ACLPACKAGE.TSP_BUILDACL.DIVISION OR
SJR_DIVISION IS NULL )
AND ROWNUM = 1;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
V_ROLEID := 0;
END;
END;
END IF;

--Based on the role Identify Level if necessary
IF V_LOCATIONLEVEL IS NULL THEN
IF V_ROLEID IS NOT NULL THEN
BEGIN
SELECT SCR_LEVEL INTO V_LOCATIONLEVEL FROM SEC_ROLES WHERE
SCR_ROLEID = V_ROLEID AND ROWNUM = 1;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
V_LOCATIONLEVEL := TSP_ACLPACKAGE.TSP_BUILDACL.LOCATIONLEVEL ;
END;
END;
ELSE
V_LOCATIONLEVEL := TSP_ACLPACKAGE.TSP_BUILDACL.LOCATIONLEVEL ;
END IF;
END IF;

OPEN ACLCURSOR FOR
SELECT TSE_LOCATIONLEVEL AS locationlevel, TSE_LOCATIONID as locationid,
TSE_ROLEID as roleid
FROM TOT_TSPEXCEPTIONS
WHERE LOWER(TSE_EMPLOYEEID) = LOWER(TSP_ACLPACKAGE.TSP_BUILDACL.USERID)
AND TSE_EXCEPTIONTYPE = 'A'
--UNION
--SELECT V_LOCATIONLEVEL, V_LOCATIONID, V_ROLEID FROM DUAL
;
--ACLCURSOR := V_ACLCURSOR ;

END TSP_BUILDACL;



System.Data.OracleClient.OracleException: ORA-24338: statement handle not
executed
at System.Data.OracleClient.OracleException.Check(OciHandle errorHandle,
Int32 rc)
at System.Data.OracleClient.OciHandle.GetAttribute(ATTR attribute, Int32&
value, OciHandle errorHandle)
at System.Data.OracleClient.OracleDataReader.FillColumnInfo()
at System.Data.OracleClient.OracleDataReader..ctor(OracleConnection
connection, OciHandle statementHandle)
at
System.Data.OracleClient.OracleParameterBinding.GetOutputValue(NativeBuffer
parameterBuffer, OracleConnection connection, Boolean needCLSType)
at System.Data.OracleClient.OracleParameterBinding.PostExecute(NativeBuffer
parameterBuffer, OracleConnection connection)
at System.Data.OracleClient.OracleCommand.Execute(OciHandle statementHandle,
CommandBehavior behavior, Boolean isReader, Boolean needRowid, OciHandle&
rowidDescriptor, ArrayList& refCursorParameterOrdinals)
at System.Data.OracleClient.OracleCommand.Execute(OciHandle statementHandle,
CommandBehavior behavior, Boolean needRowid, OciHandle& rowidDescriptor)
at System.Data.OracleClient.OracleCommand.ExecuteNonQueryInternal(Boolean
needRowid, OciHandle& rowidDescriptor)
at System.Data.OracleClient.OracleCommand.ExecuteNonQuery()
at leaderboardreporting.UserACL.BuildACL(String sUserID, String sDivision,
String sJobCode, String sLocationID) in v:\useracl.cs:line 100
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top