View previous topic :: View next topic
|
Author |
Message |
manjuv26
New User
Joined: 19 Feb 2007 Posts: 9 Location: usa
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
manjuv26
New User
Joined: 19 Feb 2007 Posts: 9 Location: usa
|
|
|
|
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 |
|
|
wanderer
Active User
Joined: 05 Feb 2007 Posts: 199 Location: Sri Lanka
|
|
|
|
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 |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
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 |
|
|
|