Home » Developer & Programmer » JDeveloper, Java & XML » Call DB Function from Java Hibernate (Oracle 10g)
Call DB Function from Java Hibernate [message #493804] Thu, 10 February 2011 00:47 Go to next message
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 Go to previous message
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
Previous Topic: Accessing XSD file through pl/sql
Next Topic: Can we use JSF and AJAX in Oracle iStore Aplication
Goto Forum:
  


Current Time: Wed Jul 17 16:15:50 CDT 2019