ORACLE SQLNOTFOUND 100 vs. 1403

前端之家收集整理的这篇文章主要介绍了ORACLE SQLNOTFOUND 100 vs. 1403前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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"

原文链接:https://www.f2er.com/oracle/212202.html

猜你在找的Oracle相关文章