这是我的代码:
IList<Debtor> lstdebtors = session.GetNamedQuery("SEL_DBR_BY_CLIENT").SetParameter("V_DBR_CLIENT", client)
.SetParameter("V_USER_ID", userName)
.SetParameter("V_NUMBER_OF_ROWS", maximumRows)
.SetParameter("V_STARTS_WITH", startRowIndex)
.List<Debtor>();
return lstdebtors.ToList<Debtor>();
这是我的存储过程:
create or replace
PROCEDURE "SEL_DBR_BY_CLIENT"
(
debtor_cursor OUT SYS_REFCURSOR,
V_DBR_CLIENT IN VARCHAR2,
V_USER_ID IN VARCHAR2,
V_NUMBER_OF_ROWS IN NUMBER,
V_STARTS_WITH IN NUMBER
)
IS
BEGIN
Open debtor_cursor for
SELECT
DBR_NO,
DBR_ACN,
DBR_NAME1,
CLT_NAME_1
FROM XYZ
END;
这是映射:
<sql-query name="SEL_DBR_BY_CLIENT" >
<return class="Debtor" />
{ call CDS.SEL_DBR_BY_CLIENT(:V_DBR_CLIENT,:V_USER_ID,:V_NUMBER_OF_ROWS,:V_STARTS_WITH)) }
</sql-query>
我在下面收到错误:
NHibernate.Exceptions.GenericADOException was caught
Message=could not execute query
[ { call CDS.SEL_DBR_BY_CLIENT(?,?,?,?)) } ]
Name:V_DBR_CLIENT - Value:AAA001 Name:V_USER_ID - Value:ALO Name:V_NUMBER_OF_ROWS - Value:10 Name:V_STARTS_WITH - Value:0
[SQL: { call CDS.SEL_DBR_BY_CLIENT(?,?,?,?)) }]
Source=NHibernate
SqlString={ call CDS.SEL_DBR_BY_CLIENT(?,?,?,?)) }
这是内部异常 错误[42000] [Oracle] [ODBC]语法错误或访问冲突。 请告诉我导致错误的原因。