OCI Date Conversion failed

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
Amit_111
Participant
Posts: 134
Joined: Sat Mar 24, 2007 11:37 am

OCI Date Conversion failed

Post by Amit_111 »

Hi All,

i have a source table having some date fields. i am extracting the data for these columsn in the 'Oracle OCI 9' Stage. But when I import the metadata for the same table through DataStage; the Datatype is coming as "TimeStamp 38". Why is DS importing the column datatype as "Timestamp 38" even when the format is "date" in the actual database.

I changed this "Timestamp 38" to "date" in the Soure 'Oracle Stage--> columns' tab but when i do "View Data" to see the output it is giving me error as "OCI Date Conversion failed". I am not able to get why this is happening when actually the data is in "Date" format in the source and also i want to view it as "date" format in OCI stage but still it is giving me error.

I searched for this error in the forum and found that this seems to be some DataStage error and the DataStage Support team needs to contacted for this.
But just wanted to confirm once before going for support.
Thanks in advance
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

DATE fields in Oracle are timestamps. I use them with a datatype of Timestamp without issue and actually prefer to always include the time portion of the DATE field even when it "doesn't have one".

Did you actually try it? What issues did you have?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Amit_111
Participant
Posts: 134
Joined: Sat Mar 24, 2007 11:37 am

Post by Amit_111 »

Actually, i kept them as it is initially and did the "View Data" but then i got the error saying "Attempt to convert string value '01-SEP-01' to Timestamp type unsuccessful".
But i checked the source datatype in table table and it is actually a date format.

Still i then changed the timestamp to varchar and then i was able to see the data through 'View Data'. Again i changed the Varchar to date and tried "View Data" which gave me the error "OCI Date Conversion failed". Dont know why this is happening even though it is a date format in the Source table.
csri
Participant
Posts: 99
Joined: Wed Jul 11, 2007 8:02 am

Re: OCI Date Conversion failed

Post by csri »

Amit_111 wrote:Hi All,

i have a source table having some date fields. i am extracting the data for these columsn in the 'Oracle OCI 9' Stage. But when I import the metadata for the same table through DataStage; the Datatype is coming as "TimeStamp 38". Why is DS importing the column datatype as "Timestamp 38" even when the format is "date" in the actual database.

I changed this "Timestamp 38" to "date" in the Soure 'Oracle Stage--> columns' tab but when i do "View Data" to see the output it is giving me error as "OCI Date Conversion failed". I am not able to get why this is happening when actually the data is in "Date" format in the source and also i want to view it as "date" format in OCI stage but still it is giving me error.

I searched for this error in the forum and found that this seems to be some DataStage error and the DataStage Support team needs to contacted for this.
But just wanted to confirm once before going for support.
Thanks in advance
You are extracting the data with date fields from the source table... what is the query that you are using? Are you converting the Oracle date to timestamp format? If you want to see only date portion of the Oracle date field then you have to do to_char(datefield,'YYYY-MM-DD'). Please more details on the source stage.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Amit_111 wrote:Actually, i kept them as it is initially and did the "View Data" but then i got the error saying "Attempt to convert string value '01-SEP-01' to Timestamp type unsuccessful".
But i checked the source datatype in table table and it is actually a date format.
Datatype is only one piece of the puzzle. Your SQL is the other. Generated SQL will always wrap a TO_CHAR() around a DATE field - I'm guessing you are using custom sql, yes?
-craig

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