Help with renameing tables from plsql [message #369685] |
Mon, 14 August 2000 10:14  |
tommy
Messages: 22 Registered: July 2000
|
Junior Member |
|
|
I am trying to have an automated process that will rename tables everyday, but I can not seem to get my alter statement to work.
ALTER TABLE ("OCC" || select to_char(sysdate - 15,'YYYYMMDD') from dual ||"DAILY")
RENAME TO ("OCC" || select to_char(sysdate,'YYYYMMDD') from dual ||"DAILY");
any one have any ideas?
|
|
|
Re: Help with renameing tables from plsql [message #369686 is a reply to message #369685] |
Tue, 15 August 2000 01:56  |
PC
Messages: 6 Registered: August 2000
|
Junior Member |
|
|
DECLARE
tab_name VARCHAR2(20);
BEGIN
SELECT To_Char(SYSDATE,'YYYYMMDD')
INTO tab_name
FROM dual;
-- Then compose the following string:
"RENAME TABLE original_name TO '||'OCC'||tab_name||'DIALY';
...
...
...
|
|
|