Oracle OCI Stage not inserting null timestamp record

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
rodre
Premium Member
Premium Member
Posts: 218
Joined: Wed Mar 01, 2006 1:28 pm
Location: Tennessee

Oracle OCI Stage not inserting null timestamp record

Post by rodre »

I have a simple job that suppose to insert one record into an oracle table.

Tried all kind of things but will not insert the record if it has a null or anything else such as 0000-00-00 00:00:00, etc. Running the sql in SQL Developer, inserts fine, but the same code in OCI stage it either will not insert it or aborts.

The timestamp is nullable in the OCI table and transformer stage.

My job looks like this: dummy file------>transformer-------->OCI

Here is my SQL:
INSERT INTO MY_TABLE(Batch_Id,StartDate,EndDate,Status) VALUES (5555,TO_DATE(sysdate, 'YYYY-MM-DD HH24:MI:SS'),NULL,'Test');

I searched the forum but nothing relevant.

Any idea why?
rodre
Premium Member
Premium Member
Posts: 218
Joined: Wed Mar 01, 2006 1:28 pm
Location: Tennessee

Post by rodre »

I found the solution. I made the timestamp into varchar in the transformer and I can pass the null okay, though oracle is expecting a date.
ketfos
Participant
Posts: 562
Joined: Mon May 03, 2004 8:58 pm
Location: san francisco
Contact:

Post by ketfos »

Hi
You can use @null function in the transformer for this column
It will insert value in the table for teh date field ,if it allows null values.
Ketfos
ketfos
Post Reply