PROCEDURE get_cust_info(cust_no in number,cust_info out rc)
is
param SPK_CUST_TYPES.customer_type;
l_data customer_type_table := customer_type_table();
Begin
SPK_REUSE.GET_CUSTOMER_INFO(cust_no,param);
l_data.extend;
l_data(1) :=
customer_type(
param.name,
param.surname);
open cust_info for
select *
from TABLE ( cast ( l_data as customer_type_table) );
end;
–type rc is ref cursor
PACKAGE SPK_CUST_TYPES
IS
TYPE customer_type IS RECORD (
name varchar2(50),
surname varchar2(50));
END;
–type customer_type_table as table of customer_type
TYPE customer_type as object (
name varchar2(50),
surname varchar2(50));
SPK_REUSE is
PROCEDURE GET_CUSTOMER_INFO(cust_no in number,cust_info out SPK_CUST_TYPES.customer_type) IS
cursor cur_cust is select
name,surname from customer_table where customer_no=cust_no;
begin
for row_cust in cur_cust loop
cust_info.name := row_cust.name;
cust_info.surname := row_cust.surname;
end;
END GET_CUSTOMER_INFO;
As i told you friends before , when i run the get_cust_info(cust_no in number,cust_info out rc) i can get the customers name and surname, there is no problem, but when i try to get other customer information (such as their addresses) by adding new columns into the customer_type objects this time i get previous exception (Execution failed: Refer to the output window), i checked all variables that i added their types are correct, customer data is correct, but it gets exception, the reason may be related with the number of columns that i try to get? are there any limitations?