Oracle "object" type and C#...

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
clsimeone
Posts: 1
Joined: Wed 13 Apr 2005 18:23

Oracle "object" type and C#...

Post by clsimeone » Wed 13 Apr 2005 18:34

I'm interested in purchasing OraDirect.NET, but first I need to know if I can do the following...

I have defined a "Contact" class in C#.

I have also defined (in an Oracle db schema) an "oraContact" object. The "oraContact" is an "object" type and is used as parameters in stored procs.

Using OraDirect.NET, I would like to pass my C# contact object as a parm to an oracle stored procedure that expects an "oraContact" object. Can this be done?

Thanks,
Chris

Byte
Posts: 2
Joined: Mon 11 Apr 2005 11:18
Location: Russian Federation
Contact:

Post by Byte » Thu 14 Apr 2005 06:01

Let we have

Code: Select all

type MY_OBJECT as object( param1 in varchar, ..., paramN in varchar)
and the oracle stored proc

Code: Select all

P_MYPROC( pOBJ in MY_OBJECT )
Our

Code: Select all

OracleConnection myConnection
is initialized and opened.

First, we create a command and bind it to the connection:

Code: Select all

OracleCommand com = new OracleCommand();
com.Connection = myConnection;
Then whe create N input parameters using the master named param1, ..., paramN.

The type of our Command is "Text". Type in the master the following command:

begin
P_MYPROC( MY_OBJECT( :param1, ..., paramN ) );
end;

Try it.

Post Reply