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

Query related to inserting an auto populated value in db2


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

PostPosted: Fri Dec 18, 2015 12:14 am
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

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Fri Dec 18, 2015 5:43 am
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: 275
Location: Mumbai

PostPosted: Fri Dec 18, 2015 9:03 am
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: 2455
Location: Hampshire, UK

PostPosted: Sat Dec 19, 2015 5:58 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Underscore was not populated to onlin... CICS 1
Search our Forums:

Back to Top