First, we need to connect all the elements in the set with strings to form a long string, as shown below:
String IDs = "";
Foreach (string STR in List)
{
IDS = IDs + STR + ",";
}
// Remove the last comma
IDS = IDs. substring (0, IDs. Length-1 );
Then write the Stored Procedure
Create or replace procedure procname
(
Inids varchar2
)
Is
Startposition number (10 );
Len number (10 );
Output varchar2 (100 );
V_id number (38 );
Begin
Loop
Select instr (inids, ',', startposition) into Len from dual;
If Len! = 0 then
Select substr (inids, startposition, len-startposition) into output from dual;
V_id: = to_number (output );
-- Write the processing code here
Else
Select substr (inids, startposition) into output from dual;
V_id: = to_number (output );
-- Write the processing code here
Exit;
End if;
Startposition: = Len + 1;
End loop;
End;
How C # joins orcal stored procedures is another topic.