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
 

 

NOt able to pass NUll values to a date field

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

New User


Joined: 24 Nov 2005
Posts: 49
Location: chennai

PostPosted: Thu Aug 02, 2012 12:18 pm    Post subject: NOt able to pass NUll values to a date field
Reply with quote

I am trying to insert the null values into a date field but the current date is getting populated in to the date filed in the table.

Please advise

thanks,
akash
Back to top
View user's profile Send private message

xknight

Active User


Joined: 22 Jan 2008
Posts: 117
Location: Liberty city

PostPosted: Thu Aug 02, 2012 12:29 pm    Post subject:
Reply with quote

Hello,

Quote:
I am trying to insert the null values into a date field but the current date is getting populated in to the date filed in the table.


Ensure the field is nullable and try using the null indicator to -1.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 02, 2012 12:42 pm    Post subject:
Reply with quote

akashs wrote:
Please advise


how about you advising us:

what is the ddl for the column in question?

what is the sql that you used
and the pic clauses of any host-variables that you used?

without the above information,
no one can give you an adequate and informed answer,
and teach you what you need to learn
or point you in the right direction in the manuals.
Back to top
View user's profile Send private message
akashs

New User


Joined: 24 Nov 2005
Posts: 49
Location: chennai

PostPosted: Thu Aug 02, 2012 2:16 pm    Post subject: Reply to: NOt able to pass NUll values to a date field
Reply with quote

IN the table the field INT_DATE is declared as date and in the dclgen it's declaration is :INT-DATE is PIC x(10). For passing null to that date field in the program i have used null indicator but current date is getting populated during the insertion of that field into the table .
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 02, 2012 2:24 pm    Post subject:
Reply with quote

let me rephrase my earlier requirements for information:

cut and paste the line describing the column from the DECLARE table statement.

cut and paste the SQL that you are using.

cut and paste the element definitions (to include pic clause)
of all host variables used in the problem SQL.

in order to keep this thread short, two assumptions:
1. your column definition in the DECLARE table statement includes the verbiage:
NOT NULL WITH DEFAULT

2. There is an INSERT TRIGGER associated with the table.

my guess is 1.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2425
Location: Netherlands, Amstelveen

PostPosted: Thu Aug 02, 2012 2:43 pm    Post subject:
Reply with quote

Quote:

cut and paste


Well Dick, that will leave the TS with no source in the end.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 02, 2012 2:46 pm    Post subject:
Reply with quote

while we are waiting for you to decide if we actually need the info requested,
in order to provide assistance,
i will take advantage of a teaching moment that has arisen, yet again.

Please read Using Nulls in DB2
it is an informative article and explains why you can not pass null values to a column:
because there is no such thing as null value(s).

PeterHolland wrote:
Well Dick, that will leave the TS with no source in the end


based on what we know of the TS so far,
why is that a bad thing?
Back to top
View user's profile Send private message
seagull

New User


Joined: 28 May 2007
Posts: 24
Location: Dublin

PostPosted: Thu Aug 02, 2012 6:55 pm    Post subject:
Reply with quote

What product are you using to view your table? We have platinum, and it displays null dates as current date, but with N in the null indicator field.
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 Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts setting new limit Key values for inde... srilata83 DB2 1 Fri Feb 10, 2017 9:24 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm
No new posts Checking Current date vickey_dw DFSORT/ICETOOL 1 Wed Feb 08, 2017 11:14 pm
No new posts 2 byte YEAR from Y'DATE2' field tecnokrat DFSORT/ICETOOL 2 Tue Feb 07, 2017 12:05 pm


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