Date format problem

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
HemaV
Participant
Posts: 63
Joined: Wed Jan 09, 2008 1:38 am
Location: Bangalore

Date format problem

Post by HemaV »

I have the date value in the oracle source database table for the column(varchar datatype) I have value either as "0000/00/00 00:00:00" or "00/00/00 00:00:00".
When I select these records and try to insert into a target database table when I try to insert into the column(date datatype), I am getting error like invalide month.

My job looks like:
SourceOracleStage----->TransformerStage----->TargetOracelStage.

Can anyone of you suggest me how to insert a NULL value for the above two formats. Is there any generalized method where I can check if i have 0 date values then insert a NULL value?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I would try stripping all of the non-numeric values and then check for zero:

Code: Select all

If DIGITS(Link.DateField) = 0 Then @NULL Else Link.DateField
(assuming no other transformations are needed)
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The first date is YMD order. Is the second date also YMD order? If not, what is the order of the day, month and year components, and have you informed Oracle that such is the case?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply