Desired date format (YYYY-MM-DD) to be loaded to Oracle DB

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
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

Post by Raftsman »

Your target database is Oracle. Set it's default to YYYY-MM-DD.
Jim Stewart
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Re: Desired date format (YYYY-MM-DD) to be loaded to Oracle

Post by gateleys »

If your input data is in YYYY-MM-DD format, then leave it as it is. During the load, if you are using any of the Oracle stages, it will convert it to the desired Oracle format (MM/DD/YYYY). The load stage performs a TO_DATE function on the input date which results in the format as is expected by Oracle.

However, if your intention is to store the dates in Oracle in YYYY-MM-DD, then it is outside the scope of DataStage, and has to be done in Oracle.
gateleys
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:!: I'd be really careful about giving advice like that - any idea how many processes that rely on the NLS_DATE format being defaulted that you might break with that change? :shock:

If you have a successful process, why not stick with it? The 'default date format' being discussed is for external processes and is only used during a load when it has no clue what format your date is coming in as. Build processes that don't rely on any particular date format - specify it in your job. That's why stages generally build their own SQL and leverage the TO_DATE() and TO_CHAR() functions.

ps. There's no such thing as 'storing dates in Oracle in YYYY-MM-DD format'.
-craig

"You can never have too many knives" -- Logan Nine Fingers
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

chulett wrote::!: I'd be really careful about giving advice like that - any idea how many processes that rely on the NLS_DATE format being defaulted that you might break with that change? :shock:
You talkin' to me? ........ You talkin' to me? ..... 8)

Ah! Well, I am not the only one here . :lol: . Must be Rafstman's response post.

[Watched Taxi Driver last night .... again!!] :wink:
gateleys
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, the post was primarily in response to Raftsman's post, you just snuck in there at the last minute between 'Previews' and I didn't bother to adjust for it.

The 'ps' was for you, however. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

:mrgreen: :mrgreen: :mrgreen:
gateleys
Post Reply