Page 1 of 1

Oracle OCI Stage not inserting null timestamp record

Posted: Wed Dec 07, 2011 12:11 pm
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?

Posted: Wed Dec 07, 2011 1:51 pm
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.

Posted: Thu Dec 08, 2011 1:58 pm
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