Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Query related to inserting an auto populated value in db2

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

Active User


Joined: 28 Jun 2010
Posts: 102
Location: chennai

PostPosted: Fri Dec 18, 2015 12:09 am    Post subject: Query related to inserting an auto populated value in db2
Reply with quote

Hi,
I want to insert values in child table.I have seq-num field which is auto populated.so I hav not used the field itself in insert querry.
While promoting in changeman I get SQL code -407 .
Seq num is defined as smallint not null.
SQL 407 means trying to insert null value in a field declared as not null.I havnt used the field itself in insert.Any idea how to solve it??
I tried inserting the field also.I got SQL -206. Object used in a place which is not valid.I.hav no clue..Pls help
Thanks in advance
Back to top
View user's profile Send private message

RahulG31

Active User


Joined: 20 Dec 2014
Posts: 411
Location: USA

PostPosted: Fri Dec 18, 2015 12:14 am    Post subject: Reply to: Query related to inserting an auto populated value in db2
Reply with quote

Why do you think it is the Seq-num which is giving trouble?

Are you sure you are not missing any column in the insert query ?

.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1827
Location: NY,USA

PostPosted: Fri Dec 18, 2015 5:43 am    Post subject:
Reply with quote

Quote:
I want to insert values in child table.I have seq-num field which is auto populated

What do you mean my that? Did you not use next seq num prior or during the insert?
look here

Quote:
Are you sure you are not missing any column in the insert query ?

It is not necessary to place all the columns if they have defined with defaults.
Back to top
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 269
Location: Mumbai

PostPosted: Fri Dec 18, 2015 9:03 am    Post subject:
Reply with quote

Hi,

If the Seq-num is defined as smallint Not null, how its getting auto populated?

Also how you come to conclusion seq-num is the culprit for -407?

its better if you share the table structure and code snippet

Regards,
Chandan
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1932
Location: UK

PostPosted: Sat Dec 19, 2015 5:58 pm    Post subject:
Reply with quote

What has changeman got to do with this? When promoting, object are moved not executed. Are you saying that before promotion the objects worked in the environment but failed after in the same environment or failed in a different environment. If the latter then there is a discrepancy between environments. If you did not test before promotion then go shoot yourself.
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 query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts How to query MAXGENS of an existing P... Chuchulo Hatyzak JCL & VSAM 4 Wed Nov 22, 2017 10:23 pm
No new posts Native SQL Query kishpra DB2 1 Wed Nov 22, 2017 8:38 pm
No new posts Query on IEFBR14 with GDG Ashishpanpaliya JCL & VSAM 4 Tue Nov 07, 2017 8:34 pm
No new posts Query on XMITIP abdulrafi All Other Mainframe Topics 1 Wed Oct 25, 2017 6:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us