MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to insert a value

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
javedsk12
Beginner


Joined: 14 Dec 2007
Posts: 66
Topics: 36
Location: pune

PostPosted: Thu Feb 14, 2008 4:38 am    Post subject: How to insert a value Reply with quote

hi

in my insert stat i have to insert the empno,name,sal but empno is autogen it should be like lastempno+1 now i do not know what is the last empno how to write the query for same


javed
_________________
javed

-----------------------
The Word Impossible it self says i am possible(im possible)
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu Feb 14, 2008 11:38 am    Post subject: Reply with quote

javedsk12,

Define the column as Identity column with Generated always attribute, so that DB2 generates values for the column.

Check this link for syntax
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNSQJ12/5.38
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group