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

Get Last Inserted IDENTITY


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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Feb 05, 2008 2:02 pm
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
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
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
Reply with quote

Hi Joe,
try this 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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Count the number of rows updated or d... DB2 6
No new posts Records inserted in KSDS is not in so... COBOL Programming 15
No new posts generated Identity-PK: BIGINT or DECI... DB2 1
No new posts Select IDENTITY column DB2 6
No new posts How to identify the newly inserted Re... DB2 9
Search our Forums:

Back to Top