I have 12 tables (T_JAN, T_FEB, T_MAR etc..). I want to write a single procedure that can be used to extract data from any one table and output it to a csv file.
How do I get a dynamic table in a cursor?? I've tried passing a variable (of JAN or FEB or MAR) into the procedure as follows :-
create or replace procedure pr_mth_csv
(p_mth VARCHAR2)
as
v_mth VARCHAR2(5) := 'T_'||p_mth||
CURSOR TAB_DATA IS
SELECT *
FROM v_mth;
etc....
But this gives me an error of "PL/SQL: ORA-00942: table or view does not exist"
Any ideas???
Many thanks in advance.
How do I get a dynamic table in a cursor?? I've tried passing a variable (of JAN or FEB or MAR) into the procedure as follows :-
create or replace procedure pr_mth_csv
(p_mth VARCHAR2)
as
v_mth VARCHAR2(5) := 'T_'||p_mth||
CURSOR TAB_DATA IS
SELECT *
FROM v_mth;
etc....
But this gives me an error of "PL/SQL: ORA-00942: table or view does not exist"
Any ideas???
Many thanks in advance.