暂无图片
处理错误 ERROR: invalid input syntax for type numeric: "22P02"
最近更新:2024-12-21 10:44:25

适用范围

openGauss/MogDB 所有版本

问题概述

从ORACLE迁移到MogDB的存储过程,在执行时,偶尔会出现类似 ERROR: invalid input syntax for type numeric: "22P02" 的报错,其中"22P02"在存储过程代码、应用代码及数据表中都搜索不到。以下为必现报错的测试用例:

MogDB=# create or replace procedure test_sqlcode (i varchar2,o_errcode number) is
MogDB$# n number;
MogDB$# begin
MogDB$# n:=i;
MogDB$# exception when others then
MogDB$# o_errcode:=sqlcode;
MogDB$# end;
MogDB$# /
CREATE PROCEDURE
MogDB=# declare
MogDB-# o_errcode number;
MogDB-# begin
MogDB$# test_sqlcode('a',o_errcode);
MogDB$# end;
MogDB$# /
ERROR:  invalid input syntax for type numeric: "22P02"
......