I'd like to do the following in Oracle 10g (this is a contrived example to show the concepts, not real code)
create table orders (order_id NUMBER);
insert into table orders values (1);
insert into table orders values (2);
insert into table orders values (3);
TYPE NUMBER_ARRAY_T is TABLE of NUMBER;
PROCEDURE VALIDATE_ORDER_IDS(i_orders IN NUMBER_ARRAY_T, o_output OUT SYS_REFCURSOR)
IS
BEGIN
OPEN o_output FOR
select ??? from TABLE(i_orders) where ??? NOT IN (select order_id from orders);
END VALIDATE_ORDER_IDS;
The stored procedure would be called with an array containing (1,2) and we'd expect to get 3 back as a result
So, the question is, is there anyway to specify a column name where the ??? are when using a nested table as a table, so the above select statement would work?