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
 
Select values from last row of a table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
ilakkia
Warnings : 1

New User


Joined: 17 May 2008
Posts: 28
Location: chennai

PostPosted: Fri Dec 26, 2008 5:24 pm    Post subject: Select values from last row of a table
Reply with quote

How to select the values only from the last row of a table?
Back to top
View user's profile Send private message

PeD

Active User


Joined: 26 Nov 2005
Posts: 456
Location: Belgium

PostPosted: Fri Dec 26, 2008 5:37 pm    Post subject:
Reply with quote

'Last row of a table' has no real meaning. This is DB2. You are not supposed to know how the data are arranged physically in the DB2/VSAM table/file.

Do you want to know a MAX value of some column?
Back to top
View user's profile Send private message
ilakkia
Warnings : 1

New User


Joined: 17 May 2008
Posts: 28
Location: chennai

PostPosted: Fri Dec 26, 2008 6:09 pm    Post subject: Reply to: Select values from last row of a table
Reply with quote

I want to fetch the last updated row of a table?
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Fri Dec 26, 2008 10:01 pm    Post subject:
Reply with quote

Illakkia,

If your table has something like a ROW CHANGE TIMESTAMP. Its possible.
Otherwise refer the previous post.

Sushanth
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: Sat Dec 27, 2008 12:30 am    Post subject:
Reply with quote

Hello,

Quote:
I want to fetch the last updated row of a table?
For what reason? While you are reading the "the last one", others may be updated causing the one read to no longer be "last". . . icon_confused.gif

What business requirement will this support?
Back to top
View user's profile Send private message
Mukesh Pandey

Active User


Joined: 11 Nov 2008
Posts: 143
Location: India

PostPosted: Mon Dec 29, 2008 5:49 pm    Post subject:
Reply with quote

its possible if you have an indicator variable in the table.. reset the indicator variable on the row which is to be updated and query accordingly....
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: Mon Dec 29, 2008 8:32 pm    Post subject:
Reply with quote

Hello,

Quote:
its possible if you have an indicator variable in the table.. reset the indicator variable on the row which is to be updated and query accordingly....
This might have a chance at working on a table with very low add/update activity. Logically, one could believe in this, but in a busy environment, it would fail.

For example, some of my tables are updated several thousand times a minute. . . . icon_neutral.gif
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 Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 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