This is the function:
FUNCTION GET_ALL(P_USER_ID IN VARCHAR2) RETURN SYS_REFCURSOR IS
C SYS_REFCURSOR;
BEGIN
OPEN C
FOR 'SELECT * FROM XYZ WHERE USER_ID = :P_USER_ID'
USING P_USER_ID;
RETURN C;
END;
I'm trying to call this function using NHibernate, like this:
Session
.CreateSQLQuery("BEGIN ? = PKG.GET_ALL(:P_USER_ID); END;")
.SetString("P_USER_ID", "SOMEONE")
.List<XYZ>();
Any code, tips or smoke signs are welcome.
PS: I'm using NHibernate 3.3.0.GA