views:

4580

answers:

3

With reference to http://stackoverflow.com/questions/980324/oracle-variable-number-of-parameters-to-a-stored-procedure

I have s stored procedure to insert multiple Users into a User table. The table is defined like:

CREATE TABLE "USER" 
   (
   "Name" VARCHAR2(50),
   "Surname" VARCHAR2(50),
   "Dt_Birth" DATE,
   )

The stored procedure to insert multiple Users is:

type userType is record (
  name varchar2(100),
...
);

type userList is table of userType index by binary_integer;

procedure array_insert (p_userList  in userList) is
begin
    forall i in p_userList.first..p_userList.last
    insert into users (username) values (p_userList(i) );
end array_insert;

How can I call the stored procedure from C# passing a userList of userType? Thanks

A: 

odp.net supports user defined types. http://www.oracle.com/technology/tech/windows/odpnet/index.html

Goole for examples or read the manual.

tuinstoel
+1  A: 
Alex
A: 

Check this nice article on this with sample code: http://developergeeks.com/article/3/oracle-user-defined-types-in-odp-.net

maniche