problem while reading from teradata database

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
RAJARP
Participant
Posts: 147
Joined: Thu Dec 06, 2007 6:46 am
Location: Chennai

problem while reading from teradata database

Post by RAJARP »

Hi,

Source:
Stage :Teradata entreprise stage source_column datatype: sql type :Timestamp, extended :microseconds, nullable:no

Target: :
Teradata entreprise stage, target_column datatype: timestampsource_column datatype: sql type :Timestamp, extended :microseconds, nullable:yes


I am having 4 such timestamp columns.out of which 3 columns are 'nullable' in source. all the four columns are 'nonnullable' in target

whiile running , i am getting the following warning multiple times

Code: Select all

crept_contact_diary,1: Data string '                          ' does not match format '%yyyy-%mm-%dd %hh:%nn:%ss.6': an integer was expected to match tag %yyyy.
Note that 'crept_contact_diary' in the warning message is my source teradata entreprise stage

kindly help me to get rid of this warning

Thanks in advance,
Raja R P
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If your target won't accept nulls, then you'll need to provide an 'in-band' value for those empty timestamps, something that equates to no date. I've seen either low or high values, like 01/01/1900 or 12/31/9999 used, amongst other values. Plus a time, of course.
-craig

"You can never have too many knives" -- Logan Nine Fingers
roydanlobo
Participant
Posts: 21
Joined: Mon Mar 01, 2010 4:55 pm

Post by roydanlobo »

When unloading the data from source you can handle nulls in your transformer Or you can do this before inserting into target according to your requirement.
As craig said use the default value like '12-31-9999 23:59:59' if null else get the value from your source.


Regards,
Roydan
RAJARP
Participant
Posts: 147
Joined: Thu Dec 06, 2007 6:46 am
Location: Chennai

Post by RAJARP »

HI,
Thanks to both of you.
Actually in first job where my terdata table was populated i have given default values for all nulls which solved my problem.
But i would like to know

Code: Select all

crept_contact_diary,1: Data string '                          ' does not match format '%yyyy-%mm-%dd %hh:%nn:%ss.6': an integer was expected to match tag %yyyy.
in the above warning message why warning is thrown from 'crept_contact_diary' stage( which is my source stage in the second job where i am reading from the table which is loaded by first job)

Thanks,
Raja R P
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

DataStage was expecting a date. A field containing all blanks is not a valid date format.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So... why is it all spaces? What was the "default value" you used for null dates when you loaded the table?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply