Home » RDBMS Server » Server Administration » Help with renameing tables from plsql
Help with renameing tables from plsql [message #369685] Mon, 14 August 2000 10:14 Go to next message
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 Go to previous message
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';
...
...
...
Previous Topic: Help:: ORA-6571 dbms_sql Dynamic sql
Next Topic: Is CRETAE TYPE command supported in Oracle8.0.5 ???
Goto Forum:
  


Current Time: Sat Oct 31 20:05:25 CDT 2020