I have a table full of data (called ORIG_DATA) that I need to insert into another table. Depending on which month I do the insert determines the table I insert into (i.e. if I do it in January then I want to insert the data into a table called JAN, if its February then into FEB and so on).
I've written a procedure that uses a parameter at runtime called v_FILEMTH, allowing the month name (JAN, FEB etc) can be entered, but I can't get my INSERT statement to work using the parameter as the table name (i.e. INSERT INTO v_FILEMTH SELECT * FROM ORIG_DATA)
Any idea how I can get this to work ??
Thanks in advance.
I've written a procedure that uses a parameter at runtime called v_FILEMTH, allowing the month name (JAN, FEB etc) can be entered, but I can't get my INSERT statement to work using the parameter as the table name (i.e. INSERT INTO v_FILEMTH SELECT * FROM ORIG_DATA)
Any idea how I can get this to work ??
Thanks in advance.