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

DB2 Interview question at HSBC


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
prasadk432

New User


Joined: 22 Dec 2007
Posts: 9
Location: Gurgaon

PostPosted: Wed Feb 06, 2008 4:41 pm
Reply with quote

In cursors after fetch statement in procedure division if you code count() whether the data updated in latest query can be accessible or not.
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: Wed Feb 06, 2008 9:56 pm
Reply with quote

Hello,

Please re-word your question.

The posted question is not clear (at least not to me icon_smile.gif ).

Please keep in mind that while your question is completely clear to you, it may not be to others who read the question.
Back to top
View user's profile Send private message
prasadk432

New User


Joined: 22 Dec 2007
Posts: 9
Location: Gurgaon

PostPosted: Tue Feb 12, 2008 12:46 pm
Reply with quote

Yes Dick,

I was asked after fetch statement in cursor if you code count statement whether you can access last updated data or not.Please give the solution
Back to top
View user's profile Send private message
ashwinreddy

Active User


Joined: 16 Sep 2004
Posts: 106
Location: Hyderabad

PostPosted: Tue Feb 12, 2008 12:59 pm
Reply with quote

Hi,

You are confused with the Questions.

How can a Fetch stmt will update a table.

or You mean you have declared a cursor with delete and trying to find count the number of rows after delete.


Cheers
Ashwin
Back to top
View user's profile Send private message
prasadk432

New User


Joined: 22 Dec 2007
Posts: 9
Location: Gurgaon

PostPosted: Tue Feb 12, 2008 1:08 pm
Reply with quote

Not like that update stmt would be issued before fetch and that updated data can be accessed after some fetch and count stmt or not.

Now I think it is clear.
Back to top
View user's profile Send private message
ashwinreddy

Active User


Joined: 16 Sep 2004
Posts: 106
Location: Hyderabad

PostPosted: Tue Feb 12, 2008 3:58 pm
Reply with quote

Hi,

Either you update the Table before fetch or after, it doesn't impact the Count in Table.

As far as i know the count will only differ from the original value when you either delete or insert a row.

Hope this Helps!

Cheers
Ashwin
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Question for file manager IBM Tools 7
No new posts question for Pedro TSO/ISPF 2
No new posts question on Outrec and sort #Digvijay DFSORT/ICETOOL 20
No new posts panel creation question TSO/ISPF 12
No new posts Sort w/OUTREC Question DFSORT/ICETOOL 2
Search our Forums:

Back to Top