Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:3.0
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.telcove.phoenix.picc.dao.common.PICCRecord"
dynamic-insert="false"
dynamic-update="false">
<id name="correlationID" type="string" >
<generator class="increment"/>
</id>
</class>
<sql-query name="Sp_Picc" callable="true">
<return class="com.telcove.phoenix.picc.dao.common.PICCRecord" />
{? = call Sp_Picc_Batch_Process(?,?) }
</sql-query>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Query q = session.getNamedQuery("Sp_Picc");
q.setInteger(0,1);
q.setDate(1,new Date(105,12,12));
q.setCharacter(2,'y');
List results = q.list();
for (Iterator i = results.iterator(); i.hasNext();) {
System.out.println(i.getClass());
}
Full stack trace of any exception that occurs:
[2006-01-01 20:15:29] DEBUG - 6390 - org.hibernate.util.JDBCExceptionReporter - could not execute query [
{? = call Sp_Picc_Batch_Process(?,?) }
]
java.sql.SQLException: ORA-01036: illegal variable name/number
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:2321)
at oracle.jdbc.oci8.OCIDBAccess.executeFetch(OCIDBAccess.java:1679)
at oracle.jdbc.oci8.OCIDBAccess.parseExecuteFetch(OCIDBAccess.java:1902)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:527)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:107)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1183)
at org.hibernate.loader.Loader.doQuery(Loader.java:363)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:203)
at org.hibernate.loader.Loader.doList(Loader.java:1499)
at org.hibernate.loader.Loader.list(Loader.java:1482)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:103)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1333)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:146)
at com.telcove.phoenix.picc.common.HibernateTest.main(HibernateTest.java:68)
Name and version of the database you are using:
Oracle 9i
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:Debug
Hi,
I have been trying to call a function and I could not escape from this error for a while.
I am trying to get the result set back from a function and many of the examples show that code need not declare the return of the resultset but when I do this..I get an error saying that i need to set 3 parameters. When I eventually set 3 of them I get the above error.
Thanks in advance.
-Ram