string to date
Moderators: chulett, rschirm, roy
string to date
tried to change the datatype varchar() to date for two fields and one is null and the other one not null.
used the function string to date(dslink102.date1,"%yyyy/%mm/%dd")
but the data is not loaded in the table.
also tried to use sequential file as target but no use.
Do I need to change the function?
Thanks
used the function string to date(dslink102.date1,"%yyyy/%mm/%dd")
but the data is not loaded in the table.
also tried to use sequential file as target but no use.
Do I need to change the function?
Thanks
Thanks,
Surya
Surya
The sample date is "2009/04/29" which is read as varchar
so I removed the double quotes by using field(dslink102.date1,'"',2)
and the column is not null so removed nulls Is IsNull(dslink102.date1) then ' '
else dslink102.date1 with the same data type varchar.
at last to change the datatype from varchar to date.
used the function string to date.
so I removed the double quotes by using field(dslink102.date1,'"',2)
and the column is not null so removed nulls Is IsNull(dslink102.date1) then ' '
else dslink102.date1 with the same data type varchar.
at last to change the datatype from varchar to date.
used the function string to date.
Thanks,
Surya
Surya
Code: Select all
IsNull(dslink102.date1) then ' '
You are the creator of your destiny - Swami Vivekananda
actually the field should be changed to not null and also the format from string to date....
the table is not accepting the values after the format change.
it says the date format is wrong
used the string to date function.
please help with any changes required in the function or the format
the table is not accepting the values after the format change.
it says the date format is wrong
used the string to date function.
please help with any changes required in the function or the format
Thanks,
Surya
Surya
I removed the null values in one of the fields by using
If IsNull() then ' ' else
after that
when I tried to change the format from varchar date I got the below error.
and the function I used for that is stringtodate
this is the exact error.
DB2_UDB_API_115,0: Invalid date value in getInputFieldAsDate() for field '3' of input dataset '0'
the table has 5 fields and in those 2 fields has DATE NULL and DATE NOT NULL
so to make the changes and to load in the tables I used transformer with the
functions mentioned.
If IsNull() then ' ' else
after that
when I tried to change the format from varchar date I got the below error.
and the function I used for that is stringtodate
this is the exact error.
DB2_UDB_API_115,0: Invalid date value in getInputFieldAsDate() for field '3' of input dataset '0'
the table has 5 fields and in those 2 fields has DATE NULL and DATE NOT NULL
so to make the changes and to load in the tables I used transformer with the
functions mentioned.
Thanks,
Surya
Surya
Has it satisfied it yet? As noted, spaces are not a valid date. You need to use an 'in-band' null value, an actual date that represents null based on your business rules, say like "12/31/9999".suryadev wrote:AS the target is not null I changed the incoming rows from null to ' ' .
will that satisfy the condition?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
sorry If I said its a time stamp, but its not a time stamp its a date.
used the function works well for one column which is not null but for another column which is null the format is changed to date but in the table the records appear like
1/1/4713 for that particular field,which is also date.
used the function works well for one column which is not null but for another column which is null the format is changed to date but in the table the records appear like
1/1/4713 for that particular field,which is also date.
Thanks,
Surya
Surya