ORACLE 手动添加时间分区
时间:2021-07-01 10:21:17
帮助过:10人阅读
V_DATE VARCHAR2(
8);
CURSOR IV_DATE
IS SELECT TO_CHAR(TO_DATE(
‘20190903‘,
‘YYYYMMDD‘)
+LEVEL-1,
‘YYYYMMDD‘)
AS 日期时间段
FROM DUAL CONNECT
BY LEVEL <= TO_DATE(
‘20200101‘,
‘YYYYMMDD‘)
-TO_DATE(
‘20190903‘,
‘YYYYMMDD‘);
BEGIN
open IV_DATE;
LOOP
fetch IV_DATE
into V_DATE;
execute immediate
‘ALTER TABLE TB_ACCEPT_JOB_D ADD PARTITION P_‘|| V_DATE
|| ‘ VALUES (‘‘‘|| V_DATE
|| ‘‘‘)‘;
END LOOP;
close IV_DATE;
END;
ORACLE 手动添加时间分区
标签:arch nec 日期时间 to_char 时间 char alt code partition