Dynamic Table Name
577178Nov 9 2007 — edited Nov 12 2007Hi,
I have a SQL script which will create a table, and will be run on a monthly basis. I want to completely automate this script if possible (ie no manual updates). The problem I'm having is trying to dynamically name it.
I want to name the table the previous year month (ie TEST_TABLE_200710).
create table test_table_to_char(trunc(sysdate),'yyyymm')-1 no logging parallel 2 as select * from dual;
The above obviously does not work. I have done a bit of digging and apparently dynamic sql is the way to go. Can anyone confirm if this is the case? Can you recommend any good reading material??
Many thanks in advance