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: 2422
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 Performing arithmetic on input field zh_lad DFSORT/ICETOOL 22 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm


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