首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

oracle中如何获得sql语句的错误信息

2014-01-28 
oracle中如何获得sql语句的错误信息:create or replace procedure pro_DataCopyAndCheck is ls_COD varchar

oracle中如何获得sql语句的错误信息

create or replace procedure pro_DataCopyAndCheck is
ls_COD varchar2(50);
ls_STA VARCHAR2(1);
ls_LNG VARCHAR2(3);
ld_EMS DATE;
ls_OPR_EMS VARCHAR2(20);
ls_REV VARCHAR2(3);
ld_REV DATE;
ls_OPR_REV VARCHAR2(20);
ls_SIG_PRD VARCHAR2(1);
ls_FIL_LAME VARCHAR2(1);
ls_COD_LAME VARCHAR2(5);
cursor get70TableData is
  select I94_COD_QCP,I94_STA_QCP,I94_LNG_QCP,D94_EMS_QCP,T94_OPR_EMS_QCP,
  I94_REV_QCP,D94_REV_QCP,T94_OPR_REV_QCP,I27_SIG_PRD,
  F94_FIL_LAME,I94_COD_LAME from TGED070_QCP_STANGING;
begin
  open get70TableData;
  fetch get70TableData into
  ls_COD,ls_STA,ls_LNG,ld_EMS,ls_OPR_EMS,ls_REV,ld_REV,
  ls_OPR_REV,ls_SIG_PRD,ls_FIL_LAME,ls_COD_LAME;
  while get70TableData%found loop
  begin
  insert into TGED070_QCP values
  (ls_COD,ls_STA,ls_LNG,ld_EMS,ls_OPR_EMS,ls_REV,ld_REV,
  ls_OPR_REV,ls_SIG_PRD,ls_FIL_LAME,ls_COD_LAME);
 
  EXCEPTION
  when others then
  update TGED070_QCP_STANGING set C_flag = "B ",Err_info = insert语句产生的错误信息
  where I94_COD_QCP = ls_cod;
  fetch get70TableData into
  ls_COD,ls_STA,ls_LNG,ld_EMS,ls_OPR_EMS,ls_REV,ld_REV,
  ls_OPR_REV,ls_SIG_PRD,ls_FIL_LAME,ls_COD_LAME;         

热点排行