Hi gurus,
I am calling function from my java code using hibernate.. When i remove [u]Where[/u] condition then its working properly..when i use where condtion its giving error.
Error:
java.lang.ArrayStoreException
at java.lang.System.arraycopy(Native Method)
at java.util.ArrayList.toArray(ArrayList.java:305)
at org.hibernate.util.ArrayHelper.toTypeArray(ArrayHelper.java:75)
at org.hibernate.impl.AbstractQueryImpl.typeArray(AbstractQueryImpl.java:674)
at org.hibernate.impl.AbstractQueryImpl.getQueryParameters(AbstractQueryImpl.java:682)
at org.hibernate.impl.SQLQueryImpl.getQueryParameters(SQLQueryImpl.java:173)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:165)
at examples.schema.GetPatientData.main(GetPatientData.java:26)
Here is the function:
CREATE OR REPLACE FUNCTION selectAllEmployments
RETURN SYS_REFCURSOR
AS
st_cursor SYS_REFCURSOR;
number1 number;
BEGIN
OPEN st_cursor FOR
SELECT p.KEY_CD,p.KEY_ORIGINAL_TXT
FROM PATIENT_DATA p where p.key_cd=kasi;
RETURN st_cursor;
END;
/
Mapping file is :
sql-query name="Query_PatientData_SP" callable="true">
<return-scalar column="KEY_CD" type="long"/>
{?=call selectAllEmployments(?)}
</sql-query>[b][quote][/quote][/b]
Please help me..
Ur help is apppreciated with full points..
Thanks
Nag
|