-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Problem with oracle stored procedure. Please help
PostPosted: Fri Nov 03, 2006 8:17 am 
Newbie

Joined: Wed Nov 01, 2006 10:54 am
Posts: 14
I could not access oracle stored procedures using nHibernate. Please help me out.

Following settings have been mentioned in my app.config file.
<nhibernate>
<add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
<add key="hibernate.dialect" value="NHibernate.Dialect.Oracle9Dialect" />
<add key="hibernate.connection.driver_class" value="NHibernate.Driver.OracleClientDriver" />
<add key="hibernate.connection.connection_string" value="" />
<add key="hibernate.show_sql" value="true" />
</nhibernate>

The content of my mapping files as follows
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns='urn:nhibernate-mapping-2.0' namespace="NHibernatePOB" assembly="NHibernatePOB" default-lazy="false">
<class name="NHibernatePOB.Bill" table="BILL_POC">
<id name="BillID" type="Int32" unsaved-value="null">
<column name="BILL_ID" sql-type="Integer" not-null="true" unique="true" />
<generator class="assigned" />
</id>
<property name="BillDesc" type="String">
<column name="BILL_DESC" length="20" sql-type="VARCHAR2" not-null="true" />
</property>
<property name="BillDate" type="DateTime">
<column name="STARTDATE" sql-type="DATE" not-null="true"/>
</property>
<sql-insert >
INSERTBILL ?,?,?
</sql-insert>
</class>
</hibernate-mapping>

The content of my class file

public class Bill
{
private int _BillID;

public int BillID
{
get { return _BillID; }
set { _BillID = value; }
}
private string _BillDesc;

public string BillDesc
{
get { return _BillDesc; }
set { _BillDesc = value; }
}
private DateTime _BillDate;

public DateTime BillDate
{
get { return _BillDate; }
set { _BillDate = value; }
}
}

Whenever I execute the application, the command type is showing as text instead of storedprocedure. Do I need to set anything in the config or mapping file to set the command type as stored procedure. Time being I’m changing the type in run-time using quickwatch.
Paramater names are showing as p0, p1, p2 instead of original values. Is that ok for Oracle?

When I use Oracle.DataAccess, application is throwing the below error.
{"ORA-01008: not all variables bound"}

When I use System.Data.OracleClient, application is throwing the below error.
{"ORA-06550: line 1, column 18:\nPLS-00103: Encountered the symbol \"\" when expecting one of the following:\n\n := . ( @ % ;\nThe symbol \"(\" was substituted for \"\" to continue.\nORA-06550: line 1, column 57:\nPLS-00103: Encountered the symbol \":\" when expecting one of the following:\n\n ( - + case mod new not null <an identifier>\n <a double-quoted delimited-identifier> <a bind variable> avg\n count current exists max min prior sql stddev su\nORA-06550: line 1, column 80:\nPLS-00103: Encountered the symbol \":\" when expecting one of the following:\n\n ( - + case mod new not null <an identifier>\n <a double-quoted delimited-identifier> <a bind variable> avg\n count current exists max min prior sql stddev su\nORA-06550: line 1, column 101:\nPLS-00103: Encountered the symbol \":\" when expecting one of the following:\n\n ( - + case mod new not null <an identifier>\n <a double-quoted delimited-identifier> <a bind variable> avg\n count current exists max min prior sql stddev s\n"}
Please help me out


Top
 Profile  
 
 Post subject: NHibernate - Oracle Stored Procedure Issue Fixed
PostPosted: Thu Nov 16, 2006 9:30 am 
Newbie

Joined: Wed Nov 01, 2006 10:54 am
Posts: 14
Oracle.Dataaccess should be used to execute the stored procedure.

In Mapping file , change the value to oracledataclientdriver

<add key="hibernate.connection.driver_class" value="NHibernate.Driver.OracleDataClientDriver" />


The syntax to call oracle stored procedure

<sql-insert >
call INSERTBILL (:BillDesc,:BillDate,:BillID)
</sql-insert>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.