The string representation of a datetime value is out of rang

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
prmuttireddy
Participant
Posts: 30
Joined: Tue Jun 20, 2006 10:22 pm

The string representation of a datetime value is out of rang

Post by prmuttireddy »

Hi,

While i am running the job I am getting following warnings.

TRNAddSubRecVal: [IBM][CLI Driver][DB2] SQL0181N The string representation of a datetime value is out of range. SQLSTATE=22007.

Please provide how to resolve the above one.

Advanced thanks.

Regards,
PReddy.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Please provide more information. Details about your job design, your data, what you are sending to the field generating the error, etc etc. :?
-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 »

Learn what the highest date that can legally be represented in your DB2 instance is, and check that no later date is included in your data. Be wary of the format of the date also, for example don't supply mmddyyyy if yyyy-mm-dd is expected.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
prmuttireddy
Participant
Posts: 30
Joined: Tue Jun 20, 2006 10:22 pm

Post by prmuttireddy »

Hi,

Actually The scenario is

DRS stage-->Transformer-> DRS

I am changing filed date(10) to Timestamp(10) in the Transformer stage.

Regards,
Reddy.
Maveric
Participant
Posts: 388
Joined: Tue Mar 13, 2007 1:28 am

Post by Maveric »

Change the timestamp field length from 10 to 18 and try.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What does this number represent for the Timestamp data type? Is it the number of characters, or the number of fractional second digits?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jdmiceli
Premium Member
Premium Member
Posts: 309
Joined: Wed Feb 22, 2006 10:03 am
Location: Urbandale, IA

Post by jdmiceli »

If you change the field length, I think you also have to change the Display length. DB2 defaults the format of timestamps to YYYY-MM-DD HH:MM:SS.mmmmmm (I think). If the process is converting that to char or varchar, then you need more than 18 or you will truncate.

Don't know if that helps or not! :oops:

Bestest,
Bestest!

John Miceli
System Specialist, MCP, MCDBA
Berkley Technology Services


"Good Morning. This is God. I will be handling all your problems today. I will not need your help. So have a great day!"
prmuttireddy
Participant
Posts: 30
Joined: Tue Jun 20, 2006 10:22 pm

Post by prmuttireddy »

Thanks to all.
Hi Ray,

The Timestamp datatype represents the number of characters.

Actully data type that field in the database is DATE(10).

Regards,
Reddy.
Post Reply