Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to display a last inserted record in a table.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
poul_motiram
Currently Banned

New User


Joined: 05 Dec 2006
Posts: 13
Location: chennai

PostPosted: Tue Feb 20, 2007 7:49 pm    Post subject: How to display a last inserted record in a table.
Reply with quote

How to display a last inserted record in a table.
Back to top
View user's profile Send private message

prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Tue Feb 20, 2007 9:06 pm    Post subject:
Reply with quote

poul_motiram,
If ya using a Cobol pgm to update the tables u can use a simple display before u give a commit or exiting out. but does this answeres your question or do u have any spl criteria.


Thamilzan.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 755
Location: Germany

PostPosted: Wed Feb 21, 2007 3:03 pm    Post subject:
Reply with quote

Hi !

Use the MAX option in a Select in case you have a adaquate Field in your DB. Something like a timestamp of insert or update.

Select....

Into ....


,:Field01
,:Field02
,:Field03
FROM TB_TableName
WHERE TB_ID = :Key-Field
AND TS_Insert =
( SELECT MAX(TS_Insert)
FROM TB_TableName
WHERE TB_ID = :Key-Field)

Regards, 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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us