View previous topic :: View next topic
|
Author |
Message |
akashs
New User
Joined: 24 Nov 2005 Posts: 49 Location: chennai
|
|
|
|
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 |
|
|
xknight
Active User
Joined: 22 Jan 2008 Posts: 117 Location: Liberty city
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
akashs
New User
Joined: 24 Nov 2005 Posts: 49 Location: chennai
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Well Dick, that will leave the TS with no source in the end. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
seagull
New User
Joined: 28 May 2007 Posts: 24 Location: Dublin
|
|
|
|
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 |
|
|
|