dbms_output.put_line('3'||vv_add_p_sql);
elsif upper(l_table_list.partition_type_id) = 'R' then
if l_table_list.date_type_id = 0 then
vv_add_p_sql := vv_add_p_sql||'values less than (to_date('''||vv_etl_c||''',''yyyymmdd'')) tablespace ';
elsif l_table_list.date_type_id = 1 then
vv_add_p_sql := vv_add_p_sql||'values less than ('||vv_etl_c||') tablespace ';
elsif l_table_list.date_type_id = 2 then
vv_add_p_sql := vv_add_p_sql||'values less than '||'('||to_number(vv_etl_c)||')'||' tablespace ';
end if;
else raise exc_partition_type;
end if;
dbms_output.put_line('4'||vv_add_p_sql);
/** @description judge partition tablespace's data type.*/
if l_table_list.tablespace_type_id = 0 then
vv_add_p_sql := vv_add_p_sql||l_table_list.tablespace_name||' ' ;
else
if mod(extract(day from vd_deal_date),2) <> 0 then
vv_add_p_sql := vv_add_p_sql||l_table_list.tablespace_name_odd||' ' ; --odd date
else
vv_add_p_sql := vv_add_p_sql||l_table_list.tablespace_name_even||' '; --even date
end if;
end if;
dbms_output.put_line('5'||vv_add_p_sql);
/** @description judge partition compression's data type.1:compression,others:un-compression*/
if l_table_list.compression = 1 then
vv_add_p_sql := vv_add_p_sql||' compress ';
end if;
execute immediate vv_add_p_sql;
end if;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12961536/viewspace-1061432/
,如需转载,请注明出处,否则将追究法律责任。