oracle 删除表问题 oracle 数据库每天会形成一张表,如:test20101221;后面日期是变动的。我需要写个批处理每天定时删除前一天的表,如:test20101220;那位高手给写个。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你在形成新表的那里truncate掉前一天的表不更好吗? 1.在window写个定时任务,在linux使用contab在每天的凌晨去执行下面的脚本就可以了execute immediate 'drop table test'||to_char(sysdate-1,'yyyymmdd') execute immediate 'drop table test'||to_char(sysdate-1,'yyyymmdd')报错:ORA-06550:第一行,第17列PLS-00103:出现符号 “drop table test”在需要下列之一时::= , < @ %;符号":=" 被替换为“drop table test”后继续 --1/24每天凌晨删除declarejobno number;begindbms_job.submit(jobno,'begin execute immediate 'drop table test'||to_char(sysdate-1,''yyyymmdd''); end;',sysdate,'trunc(sysdate+1)+1/24');commit;end; oracle数据库文件 快速编码问题 数据库建表出错 oracle 触发器的问题? 如果不用图形界面,在AIX里怎么删除一个数据库? 如何猜测Listener经常停止的原因? ORACLE表备份问题?? import 数据时莫名其妙停止了,请高手指点! 触发器/函数不能读? 新手入门问题 oracle 求字符 长度 执行计划疑问
execute immediate 'drop table test'||to_char(sysdate-1,'yyyymmdd')
报错:
ORA-06550:第一行,第17列
PLS-00103:出现符号 “drop table test”在需要下列之一时:
:= , < @ %
;
符号":=" 被替换为“drop table test”后继续
declare
jobno number;
begin
dbms_job.submit(jobno,'begin execute immediate 'drop table test'||to_char(sysdate-1,''yyyymmdd''); end;',sysdate,'trunc(sysdate+1)+1/24');
commit;
end;