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

How to display a last inserted record in a table.


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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: 771
Location: Germany

PostPosted: Wed Feb 21, 2007 3:03 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Load new table with Old unload - DB2 DB2 6
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top