Call DB Function from Java Hibernate [message #493804] |
Thu, 10 February 2011 00:47 |
gp185007
Messages: 45 Registered: April 2005 Location: Mumbai
|
Member |
|
|
Hi,
I need to call DB function through Java Hibernate.
My Sample XML File looks like.
---------------------------------------------------------------
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<sql-query name="getchequeno" callable="true">
?:=call cz_nab_mw_fn_gen_ol_chq_no()
</sql-query>
</hibernate-mapping>
---------------------------------------------------------------
I am getting below error while reading the file
"java.lang.RuntimeException: org.hibernate.HibernateException: Errors in named queries: getchequeno"
Kindly guide me to know what is wrong ?
Thanks in advance.
Regards,
Ganesh
|
|
|
Re: Call DB Function from Java Hibernate [message #493825 is a reply to message #493804] |
Thu, 10 February 2011 02:43 |
gp185007
Messages: 45 Registered: April 2005 Location: Mumbai
|
Member |
|
|
Hi All,
Please find the sample function for reference.
================================================================
create or replace FUNCTION cz_nab_mw_fn_gen_ol_chq_no
RETURN NUMBER
IS
BEGIN
RETURN 0 ;
END;
================================================================
Thanks and Regards,
Ganesh
|
|
|