Oracle date format

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
SonShe
Premium Member
Premium Member
Posts: 65
Joined: Mon Aug 09, 2004 1:48 pm

Oracle date format

Post by SonShe »

We recently moved from DB2 (Mainframe) to Oracle 9i for one of our database. Since DB2 date datatype represents YYYY-MM-DD, in datastage the corresponding field was char(10). As part of the move to Oracle from DB2 we needed to change a lot of jobs to accomodate oracle date value (YYYY-MM-DD HH:MM:SS), except in couple of jobs where the datatype for a date field was left at char(10).

In the development environment no jobs aborted inspite of this anomaly. In the pre-production the jobs did not abort either. However, in production these 2 jobs aborted with the error "OCI has fetched tuncated data".

On analyzing the issue, we found that in development the NLS_DATE_FORMAT (from V$Parameter) was set to YYYY-MM-DD. So the char(10) defined in the 2 datastage jobs was long enough to hold the data. In production, NLS_DATE_FORMAT was set to YYYY-MM-DD HH:MI:SS. We chnaged to SQL statement to get the first 10 characters to make the jobs work.

My question is - I checked the NLS_DATE_FORMAT value in pre-production and it was same as in production. Yet the jobs never failed in pre-prod. What other areas I need to look at to find the reason for jobs "NOT FAILING" in pre-production.

I will appreciate you help. Thanks.

Bhusan
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

It's worth the time to go thru all OCI stages and correct the previous CHAR workaround for the DB2 CLI date issue. The Oracle OCI stages will generate SQL with TO_DATE and TO_CHAR functions to put data into YYYY-MM-DD YYYY:MM:SS format automagically.

Get away from the residual impact of using DB2 CLI and embrace the greatness of the Oracle stage. :lol:
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:lol:

Welcome to the Dark Side! Have a cookie.
-craig

"You can never have too many knives" -- Logan Nine Fingers
SonShe
Premium Member
Premium Member
Posts: 65
Joined: Mon Aug 09, 2004 1:48 pm

Post by SonShe »

Thanks for the reply.

Now that the changes have been done and I am into the situation where the issue has been fixed and taken care of, all I am being asked to do is "root cause analysis". I would appreciate if I can get some help to determine the cause of different behavior in my pre-production environment.

Thanks again.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Where/how did you check the NLS_DATE_FORMAT?
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Post Reply