C#: Pass a user-defined type to a Oracle stored procedure
- by pistacchio
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