C#: Pass a user-defined type to a Oracle stored procedure

Posted by pistacchio on Stack Overflow See other posts from Stack Overflow or by pistacchio
Published on 2009-06-11T10:38:11Z Indexed on 2010/04/04 5:23 UTC
Read the original article Hit count: 650

Filed under:
|
|

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

© Stack Overflow or respective owner

Related posts about c#

Related posts about Oracle