I created a simple Oracle type:
create or replace TYPE MY_TYPE AS OBJECT (ID NUMBER(30), NAME VARCHAR2(20));
Then, I created a second table type:
create or replace TYPE MY_TYPE_TABLE AS TABLE OF MY_TYPE;
Finally, I created a simply function:
create or replace FUNCTION my_function(line_id IN NUMBER) RETURN MY_TYPE_TABLE
AS
return_data MY_TYPE_TABLE := MY_TYPE_TABLE();
BEGIN
return_data.EXTEND;
return_data(return_data.count) := (MY_TYPE(10, 'BOB')) ;
return_data.EXTEND;
return_data(return_data.count) := (MY_TYPE(11, 'ALAN')) ;
RETURN return_data;
END SETTLEMENT_NET_TRACKING;
My question: How to run this function that result like this:
10 BOB
11 ALAN
Hot to do it?