日期:2014-05-16  浏览次数:20581 次

主键重复

?

如何根据oracle异常判断主键重复

?

exception?
? ?? ?when others then?
? ?? ?? ?? ?? ?err_num := SQLCODE;
? ?? ?? ?? ?? ?if err_num = 1 then
? ?? ?? ?? ?? ???dbms_output.putline(SQLERRM(err_num);
? ?? ?? ?? ???end if;
...