HI I am using NHibernate30.As per our requirement we need to send User 
Defined data type(i.e Custom Data Type ) as a parameter to stored 
procedure.With ADO.net this is working

following are my Stored Procedure,Type and domain Object .

************Store Procedure***************
<pre><code> 
**********************Procedure*********************************** 
PROCEDURE "TESTCUSTOMEMPLOYEE" ("PARAM" IN "EMPLOYEECUSTOMTEST", 
 "PARAM1" OUT SYS_REFCURSOR) IS 
BEGIN 
 open PARAM1 for select * from employee; 
END;</pre></code> 

<pre><code> 
**********************User Defined Type In 
Oracle11g*********************************** 
Create or Replace TYPE "EMPLOYEECUSTOMTEST" AS OBJECT 
( 
  "EMPLOYEEID" NUMBER(38,90), 
  "EMPLOYEENAME" VARCHAR2(200), 
) 
</pre></code> 

<pre><code> 
************************Call from 
NHibernate************************************* 
  EmployeeType EMPCUST = new EmployeeType(); 
  EMPCUST.EmployeeId = 255060; 
  EMPCUST.EmployeeName = "PALLAVI"; 
  ISQLQuery final = eventhistorysession.CreateSQLQuery("CALL 
TESTCUSTOMEMPLOYEE param = :id"); 
  final.SetParameter("id", EMPCUST,new EMPLOYEECUSTOMTEST()); 
  IList result = final.List(); 
  tx.Commit(); 
</pre></code> 

<pre><code> 
**************************Exception*************************************** 
 InnerException: System.ArgumentException 
       Message="Invalid parameter binding\r\nParameter name: :p0" 
       Source="Oracle.DataAccess" 
       ParamName=":p0" 
       StackTrace: 
</pre></code> 

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to