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
|