something about date

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

sylvan_rydes
Participant
Posts: 47
Joined: Wed Apr 12, 2006 12:13 pm

Post by sylvan_rydes »

That was the only reason behind it. Thanks.

Now can you help me to figure out a way So I can upload a constant string type in date type OCI stage.
sylvan rydes
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

kcbland wrote:Day 0 in the DS BASIC internal date world is 1969-12-31. Somehow you're getting to there in your manipulations.
1967-12-31 :oops:
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 »

sylvan_rydes wrote:Now can you help me to figure out a way So I can upload a constant string type in date type OCI stage.
You just... do it. :? Make sure it is in the format the datatype is expecting. For example, declared as a Timestamp it would need to be in the format YYYY-MM-DD HH24:MI:SS to 'upload' correctly, assuming you are using the generated sql.
-craig

"You can never have too many knives" -- Logan Nine Fingers
avi21st
Charter Member
Charter Member
Posts: 135
Joined: Thu May 26, 2005 10:21 am
Location: USA

Post by avi21st »

chulett wrote:
sylvan_rydes wrote:Now can you help me to figure out a way So I can upload a constant string type in date type OCI stage.
You just... do it. :? Make sure it is in the format the datatype is expecting. For example, declared as a Timestamp it would need to be in the format YYYY-MM-DD HH24:MI:SS to 'upload' correctly, assuming you are using the generated sql.
You should do a TO_CHAR(column_name,YYYY-MM-DD HH24:MI:SS') while selecting date field. Also dont key in metadata definition-import it. Then in user defined query in OCI stage use this TO_CHAR.

I hope it helps.
Avishek Mukherjee
Data Integration Architect
Chicago, IL, USA.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There's absolutely no reason to use User Defined SQL to do that - the stage will automatically generate the 'proper' TO_CHAR (and the corresponding TO_DATE) sql for you based on the datatype.

IMHO, user defined sql should be avoided at all costs, only when you've got no other choice should you fall back to it. Too many opportunities for error with it and you increase the maintenance workload of the job that uses it.
-craig

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