IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to identify End of table or Record not found


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manjuv26

New User


Joined: 19 Feb 2007
Posts: 9
Location: usa

PostPosted: Thu Feb 22, 2007 4:31 am
Reply with quote

Hi
How to identify whether we have reached end of table or record not found when the sql return code is +100. can any one help me.

Thanks
Manju
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Feb 22, 2007 5:08 am
Reply with quote

manjuv26 wrote:
How to identify whether we have reached end of table or record not found when the sql return code is +100.
The return code says just that. Selecting on a cursor, +100 is EOF on the pseudo file, Fetching, the same thing.
EOF is EOF, whether or not it is end of table or no (additional) record found is moot.
Does this have a concern for you?
Back to top
View user's profile Send private message
manjuv26

New User


Joined: 19 Feb 2007
Posts: 9
Location: usa

PostPosted: Thu Feb 22, 2007 10:35 am
Reply with quote

Hi
Thanks for ur reply.But it is not clear for me. Actually this question asked in the interview. I need some more details information to identify whether it is a end of file or record not found.
Back to top
View user's profile Send private message
wanderer

Active User


Joined: 05 Feb 2007
Posts: 199
Location: Sri Lanka

PostPosted: Thu Feb 22, 2007 10:53 am
Reply with quote

As William has already said, they are logically same. You don't find a record when you reached the end of the table while searching. There is no way you can not-find-the-record without reaching the end of the table or your cursor set.

So how do you differentiate them? And what you mean by file?
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Thu Feb 22, 2007 9:10 pm
Reply with quote

Hi !

As wrote before:

If this is a FETCH statement, no more rows satisfy the selection values.
If this is an embedded SELECT statement, no rows satisfy the selection values.

That implies "End-of-File"

There is no special EOF-Indicator !!!

Regards, UmeySan
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Feb 22, 2007 11:48 pm
Reply with quote

Hello,

Keeping in mind that different code may be needed to deal with "No Record Found" versus "No more Records Found.

If there are "some" and then the last is processed, this is not the same as not finding "any" at all in many business situations.

It is one thing to have processed all of a customers orders - it is another if the customer has no orders or does not exist. . . .
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Fri Feb 23, 2007 5:36 pm
Reply with quote

Hi Dick !

I agree to your detailed handling on SQL-100.
It's individual and depends on internal logic.

Regards & nice Weekend
UmeySan
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts How I Found a Bug in a FORTRAN Compiler All Other Mainframe Topics 4
No new posts Load new table with Old unload - DB2 DB2 6
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top