create or replace procedure P_ADD_NODE_DAILY_PAR(pi_sday in varchar,
-- pi_par_num in number,
po_return out number) is
v_upper_day date;
v_create_sql varchar(2000);
begin
execute immediate 'alter session set nls_date_format = ''YYYYMMDDHH24MISS''';
v_upper_day := to_date(pi_sday, 'YYYYMMDD') + 1;
v_create_sql := 'ALTER TABLE NODE_BANDWIDTH_DAILY ADD PARTITION P' ||
pi_sday || ' VALUES LESS THAN (:1)';
/* v_create_sql := ' ALTER TABLE NODE_BANDWIDTH_DAILY ADD PARTITION P' ||
pi_sday ||
' VALUES LESS THAN(to_date('''||pi_sday||''','' YYYYMMDD'') + 1)';
*/
dbms_output.put_line(v_create_sql);
dbms_output.put_line(v_upper_day);
execute immediate v_create_sql
using v_upper_day;
/* po_return := 1;
exception
when others then
dbms_output.put_line(v_upper_day);
po_return := 0;*/
end P_ADD_NODE_DAILY_PAR;
declare
v_ret number;
begin
P_ADD_NODE_DAILY_PAR('20070730',v_ret);
end;
ORA-14019: partition bound element must be one of: string, datetime or interval literal, number, or MAXVALUE
ORA-06512: at "FLUX.P_ADD_NODE_DAILY_PAR", line 19
ORA-06512: at line 4
先谢啦!
-- pi_par_num in number,
po_return out number) is
v_upper_day date;
v_create_sql varchar(2000);
begin
execute immediate 'alter session set nls_date_format = ''YYYYMMDDHH24MISS''';
v_upper_day := to_date(pi_sday, 'YYYYMMDD') + 1;
v_create_sql := 'ALTER TABLE NODE_BANDWIDTH_DAILY ADD PARTITION P' ||
pi_sday || ' VALUES LESS THAN (:1)';
/* v_create_sql := ' ALTER TABLE NODE_BANDWIDTH_DAILY ADD PARTITION P' ||
pi_sday ||
' VALUES LESS THAN(to_date('''||pi_sday||''','' YYYYMMDD'') + 1)';
*/
dbms_output.put_line(v_create_sql);
dbms_output.put_line(v_upper_day);
execute immediate v_create_sql
using v_upper_day;
/* po_return := 1;
exception
when others then
dbms_output.put_line(v_upper_day);
po_return := 0;*/
end P_ADD_NODE_DAILY_PAR;
declare
v_ret number;
begin
P_ADD_NODE_DAILY_PAR('20070730',v_ret);
end;
ORA-14019: partition bound element must be one of: string, datetime or interval literal, number, or MAXVALUE
ORA-06512: at "FLUX.P_ADD_NODE_DAILY_PAR", line 19
ORA-06512: at line 4
先谢啦!
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9375/viewspace-555136/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/9375/viewspace-555136/