加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ORACLE SQLNOTFOUND 100 vs. 1403

发布时间:2020-12-12 15:51:19 所属栏目:百科 来源:网络整理
导读:ORACLE SQLNOTFOUND 100 vs. 1403 Problem statement When using COBOL read Oracle database,the SQLNOTFOUND sometimes return 100,and sometimes return 1403,what's the difference. What is SQLCODE definition according to Oracle The function SQLCO

ORACLE SQLNOTFOUND 100 vs. 1403


Problem statement

When using COBOL read Oracle database,the SQLNOTFOUND sometimes return 100,and sometimes return 1403,what's the difference.



What is SQLCODE definition according to Oracle

The function SQLCODE returns the number code of the most recent exception.

For internal exceptions,SQLCODE returns the number of the associated Oracle error.

The number that SQLCODE returns is negative unless the Oracle error is no data found,in which case SQLCODE returns +100.



So


  • +1403 is the Oracle SQLCODE for a NOT FOUND,and
  • +100 is the ANSI SQLCODE for a NOT FOUOND.


The default for Pro*COBOL MODE is ORACLE. (It can be changed by setting MODE=ANSI)

Another way,we can use END_OF_FETCH=100,together with MODE=ORACLE to reset SQLCODE for 100.



case 1: NOT FOUND SQLCODE=1403

.pco.cbl:

procob $(PCCINCLUDE) iname=$*.pco lname=$*.lis oname=$*.cbl

or

procob $(PCCINCLUDE) iname=$*.pco lname=$*.lis oname=$*.cbl mode=oracle


case 2: NOT FOUND SQLCODE=100

.pco.cbl:

procob $(PCCINCLUDE) iname=$*.pco lname=$*.lis oname=$*.cbl mode=ansi


case 3: NOT FOUND SQLCODE=100

.pco.cbl:

procob $(PCCINCLUDE) iname=$*.pco lname=$*.lis oname=$*.cbl mode=oracle end_of_fetch=100


case 2: NOT FOUND SQLCODE=1403

.pco.cbl:

procob $(PCCINCLUDE) iname=$*.pco lname=$*.lis oname=$*.cbl mode=ansi end_of_fetch=1403


# PCCINCLUDE format

# export PCCINCLUDE="include=/path_to_dir/dir1:/path_to_dir2/dir2"

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读