Part of a stored procedure I'm writing (on an Oracle DB) will return an array of integer values to a c# app. I've never done this before and I can't find info online on how to do this inside of the stored procedure.
On the C# side, I've connected to the DB and created a stored procedure command. I'm using:
cmd.Parameters.Add("returnID", OracleDbType.Array, ParameterDirection.Output);
To grab the array.
Inside of the Stored Procedure, I have:
CREATE OR REPLACE PROCEDURE ODM(/* not relevant*/, returnIDs OUT ARRAY)
IS
BEGIN
...
END ODM;
Where returnIDs is the array I want to output, full of integers.
I need to be able to loop through a table, ORDERS, and grab all integer primary keys between two values, and add them into returnIDs.
I'm hoping theres soemthing similar to an insert into the array, where the primary key is between the min and max value, but I'm not sure.
What's the syntax to be able to declare those values, loop through the table and add into my output array?
EDIT: solution: Bulk Collect would work for this, but it's much easier just to return the min and max values to my program and then just do a separate select in there.