Quote:
Originally posted by padderz
Likewise any pointers to exactly what you tried and what error you got would be great.
|
declare
TYPE Rec_Type IS RECORD
(A NUMBER,
B VARCHAR2(10),
C NUMBER);
v_column_name VARCHAR2(10) := 'B';
TYPE Tbl_Type IS TABLE OF Rec_Type
INDEX BY BINARY_INTEGER;
v_value NUMBER;
v_tbl_type Tbl_type;
begin
v_tbl_type(1).A := 10;
v_tbl_type(1).B :='MISSING';
v_tbl_type(1).C := 5;
v_tbl_type(1).A := 6;
v_tbl_type(1).B :='PERSON';
v_tbl_type(1).C := 15;
begin
execute immediate
'begin'||
':x := v_tbl_type(1).'||v_column_name ||';'||
'end;'
using OUT v_value;
dbms_output.put_line('Value of A is ' || v_value);
end;
end;
/
ERROR at line 1:
ORA-06550: line 1, column 12:
PLS-00201: identifier 'V_TBL_TYPE' must be declared
ORA-06550: line 1, column 6:
PL/SQL: Statement ignored
ORA-06512: at line 19