逐条插入的时候可以通过定义内部块和异常处理,使其他记录能继续插入 请问下这个内部块和异常处理 是怎么操作的?
解决方案 »
- linux如何安装oracle数据库所需的包呢?
- ado方式连oracle,Data Source为什么不能用ip地址
- oracle与j2ee那个方向好?
- vc555vc555vc555vc555vc555vc555大家都来看看!!!!!!!!!!!!!!
- 使用PL/SQL Developer将excel导入oracle的问题
- 100分求一巨难页而且很实用的SQL语句!!
- 在oracle8i中这个怎么写
- 如何某个用户下的所有表??
- 在oracle中如何实现sql server中的print?
- 这个SQL怎么写?
- 谁有ORACLE.JAR 90多兆,的相关API啊?
- oracle job定三个不同时间点运行。
SQL> create table test (id number);Table createdSQL> alter table test add constraint pk_id primary key (id);Table alteredSQL> insert into test values(1);1 row insertedSQL> insert into test values(1);insert into test values(1)ORA-00001: 违反唯一约束条件 (MMSRPT1.PK_ID)SQL> declare
2 error_primary exception;
3 pragma exception_init(error_primary, -1);
4
5 v_tabname varchar(30);
6 v_sqlstring varchar(1024);
7 begin
8 begin
9 insert into test values(1);
10 exception
11 when error_primary then
12 null;
13 end;
14
15 insert into test values(2);
16 commit;
17 exception
18 when others then
19 dbms_output.put_line(substr(sqlerrm, 1, 200));
20 end;
21 /PL/SQL procedure successfully completedSQL> select * from test; ID
----------
1
2SQL>