Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm trying to load a table through the tOracleOutput component. I have a table which has a column defined as:
CREATE TABLE TEST_NULL
(
COLUMN1 varchar2(200)
, DEFAULT_VALUE NUMBER DEFAULT '-1' NOT NULL
)
now I can't seem to be able to find a working combination, together with the tOracleOutput component, which is able to use this table definition.
I either get nullpointer exceptions in my job, or "cannot insert null value" oracle errors.
Alternatively I see that the tOracleOutput component has got a "default" column, but also from that option I can't seem to find any documentation, or get it to work.
Anyone has got some advice?
thanks in advance for your help.
First of all, the default value in the schema will only be applied while creating the table and does not have any effect while inserting/updating data.
Second, default values in the database will only be applied if you do not have this column in your insert statement!
If you simply send null values, the database takes this null value and this will e.g. violate against a not-null-constraint.
The NullPointerException comes typically from the fact, you have in your source a null value (any numeric value) and your table output schema column is a primitive data type like int or long (etc) and now Java tries to unbox the given numeric object to the primnitive data type. This leads to the NullPointerException.
Conclusion: Check where you apply a Integer or Long or Double to a int, long or double typed column and take care your source does not send null values here!