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
 

 

Get Last Inserted IDENTITY

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

New User


Joined: 27 Jul 2007
Posts: 11
Location: india

PostPosted: Tue Feb 05, 2008 1:40 pm    Post subject: Get Last Inserted IDENTITY
Reply with quote

Hello,

I need to know the last inserted IDENTITY into a table.

Searching the web I've found to use SCOPE_IDENTITY(), but I'm not able to use this one.

Can anybody please let me know how we can find out the last inserted IDENTITY into the table.

Thanks & Regards,
Joe
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Tue Feb 05, 2008 2:02 pm    Post subject: Reply to: Get Last Inserted IDENTITY
Reply with quote

did You search for "db2 last identity"
You will find many useful links
( also the pro and cons about using such facility, mostly cons icon_biggrin.gif )
Back to top
View user's profile Send private message
mauvis

New User


Joined: 27 Jul 2007
Posts: 11
Location: india

PostPosted: Tue Feb 05, 2008 3:02 pm    Post subject: Get Last Inserted IDENTITY
Reply with quote

Hello,

I'll want to know how can I make use of this. I didn't find anything for this.

please let me know.

Thanks & Regards,
Joe
Back to top
View user's profile Send private message
abhishekmdwivedi

New User


Joined: 22 Aug 2006
Posts: 95
Location: india

PostPosted: Tue Feb 05, 2008 4:28 pm    Post subject: Reply to: Get Last Inserted IDENTITY
Reply with quote

Here's a link which will help you :
http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/admin/r0004231.htm
Back to top
View user's profile Send private message
ulfnsc

New User


Joined: 15 Jan 2004
Posts: 19
Location: Stockholm, SWEDEN

PostPosted: Tue Feb 05, 2008 4:51 pm    Post subject:
Reply with quote

Hi Joe,
try this http://www.craigsmullins.com/dbu_0204.htm

/uffe
Back to top
View user's profile Send private message
mauvis

New User


Joined: 27 Jul 2007
Posts: 11
Location: india

PostPosted: Tue Feb 05, 2008 5:47 pm    Post subject:
Reply with quote

Thanks Everyone...It worked out for me with IDENTITY_VAL_LOCAL()!
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 Count the number of rows updated or d... Chetan Kumar DB2 6 Tue Jul 14, 2015 7:57 pm
No new posts Records inserted in KSDS is not in so... raviprabhu COBOL Programming 15 Thu Jan 02, 2014 9:25 pm
No new posts generated Identity-PK: BIGINT or DECI... Auryn DB2 1 Mon Jan 28, 2013 5:24 pm
No new posts Select IDENTITY column dbzTHEdinosauer DB2 6 Fri Aug 31, 2012 6:26 pm
No new posts How to identify the newly inserted Re... naveensrimf DB2 9 Fri Jul 29, 2011 11:24 am


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