Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to identify End of table or Record not found

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: How to identify End of table or Record not found
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: 3158
Location: Tucson AZ

PostPosted: Thu Feb 22, 2007 5:08 am    Post subject: Re: How to identify End of table or Record not found
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    Post subject: Re: How to identify End of table or Record not found
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    Post subject: Re: How to identify End of table or Record not found
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: 757
Location: Germany

PostPosted: Thu Feb 22, 2007 9:10 pm    Post subject:
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

Site Director


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

PostPosted: Thu Feb 22, 2007 11:48 pm    Post subject:
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: 757
Location: Germany

PostPosted: Fri Feb 23, 2007 5:36 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us