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: 743
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 Display ZEDLMSG without Pressing F1 &... anandgbe CLIST & REXX 8 Thu Dec 15, 2016 4:20 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts How to display value of an exit param... lind sh CICS 2 Sun Oct 09, 2016 12:28 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am


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