这是源代码
create or replace procedure sp_procedure(tbtid number,tbname varchar2,tbarea varchar2) is
t_count number(10);
v_sql varchar2(1000);
begin
select count(*) into t_count from dual where exists
(select 1 from USER_TAB_PARTITIONS where partition_name = 'p_'||tbname);
if t_count<1 then
v_sql :='alter table ceshilifan add partition p_'||tbname||' values('||tbname||')';
execute immediate v_sql;
execute immediate 'insert into ceshilifan values (:1,:2,:3)' using tbtid,tbname,tbarea;
else
execute immediate 'insert into ceshilifan values (:1,:2,:3)' using tbtid,tbname,tbarea;
end if;
end;老是这句报错
v_sql :='alter table ceshilifan add partition p_'||tbname||' values('||tbname||')';
execute immediate v_sql;
说是
ORA-14019: partition bound element must be one of: string, datetime or interval literal, number, or MAXVALUE
求解答,谢谢啦
create or replace procedure sp_procedure(tbtid number,tbname varchar2,tbarea varchar2) is
t_count number(10);
v_sql varchar2(1000);
begin
select count(*) into t_count from dual where exists
(select 1 from USER_TAB_PARTITIONS where partition_name = 'p_'||tbname);
if t_count<1 then
v_sql :='alter table ceshilifan add partition p_'||tbname||' values('||tbname||')';
execute immediate v_sql;
execute immediate 'insert into ceshilifan values (:1,:2,:3)' using tbtid,tbname,tbarea;
else
execute immediate 'insert into ceshilifan values (:1,:2,:3)' using tbtid,tbname,tbarea;
end if;
end;老是这句报错
v_sql :='alter table ceshilifan add partition p_'||tbname||' values('||tbname||')';
execute immediate v_sql;
说是
ORA-14019: partition bound element must be one of: string, datetime or interval literal, number, or MAXVALUE
求解答,谢谢啦
解决方案 »
- oracle function 数组问题
- oracle 命令行未正确结束
- 会话之间锁的问题
- 关于oracle的时间日期转换.
- oracle程序包调用返回结果集问题
- 连接处于域中的oracle服务器,几分钟后数据库连接将会自动断开.错误为经典的'hostdef扩展名不存在',哪位大哥有比较好的解决办法?
- 对主表怎样进行级联更新,删除(语句)
- 问一个循环过程的写法?急急,在线等待,一定给分
- 在oracle9i管理工具中数据库备份为什么会失败?
- oracle里可以使用表变量吗?在线等待
- Oracle的Open()和Close()与TCP连接的关系?????
- 求救,SQL LOADER如何导入无分隔无固定长度的多行数据
注释掉 execute immediate v_sql; 看看这个sql打印出的结果,肯定是语法错了。