首页 > 数据库 >oracle 存储过程 update 更新 不报错 但是没有更新成功

oracle 存储过程 update 更新 不报错 但是没有更新成功

时间:2022-09-07 14:47:56浏览次数:83  
标签:SER DOC update 更新 NUMBER VARCHAR2 报错 TIME ORIGINAL

原因是:定义的入参的参数名称和库表字段名称一样,当入参长度和库表字段长度不一样的入参就变成了 'BC_3109814'=' BC_3109814' 导致不相等,从而更新不成功

解决:修改存储过程入参名称后面加个_P

CREATE OR REPLACE PROCEDURE "UPDATE_INSPECT_RESULT" (
FLAG_MAKE_P IN VARCHAR2,
EDIT_TIME_P IN DATE,
DOC_SER_NUMBER_P IN VARCHAR2,
DOC_TIME_P IN DATE,
VERSION_NUM_P IN VARCHAR2,
ORIGINAL_TEXT_P IN CLOB,
ORIGINAL_PDF_P IN CLOB
) AS
BEGIN
UPDATE INSPECT_RESULT a SET
a.FLAG_MAKE=FLAG_MAKE_P,
a.EDIT_TIME=EDIT_TIME_P,
a.DOC_SER_NUMBER=DOC_SER_NUMBER_P,
a.DOC_TIME=DOC_TIME_P,
a.VERSION_NUM=VERSION_NUM_P,
a.ORIGINAL_TEXT=ORIGINAL_TEXT_P,
a.ORIGINAL_PDF=ORIGINAL_PDF_P
WHERE
a.DOC_SER_NUMBER=DOC_SER_NUMBER_P;
commit;
END;

标签:SER,DOC,update,更新,NUMBER,VARCHAR2,报错,TIME,ORIGINAL
From: https://www.cnblogs.com/yr1126/p/16665354.html

相关文章