IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
 View Only
  • 1.  Insert into DB2 - TIMESTAMP NOT NULL DEFAULT CURRENT TIMESTAMP

    Posted Wed August 30, 2006 11:50 AM

    Originally posted by: SystemAdmin


    I need to insert records into a db2 table where we want DB2, not DSTX, to default the current timestamp on a LD_TS field. LD_TS is defined as 'TIMESTAMP NOT NULL DEFAULT CURRENT TIMESTAMP'. I was thinking that if I didn't include the LD_TS field in my treetype, that DSTX would not pass anything for the LD_TS and DB2 would correctly default the field. That is not the case. From looking at the DBL, DTSX not using my treetype to dynamically create the SQL so it appears as though DSTX is defaulting a "NULL" to LD_TS. My error is "Message: IBMCLI DriverDB2 SQL0407N Assignment of a NULL value to a NOT NULL column " " is not allowed."
    If you have encountered this problem before, I would appreciate any tips or suggestions.

    Thank you!
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 2.  Re: Insert into DB2 - TIMESTAMP NOT NULL DEFAULT CURRENT TIMESTAMP

    Posted Wed August 30, 2006 04:00 PM

    Originally posted by: jvanboga


    Not a DB expert by anymeans but..... Based on the way your table is defined I'd guess you can't update/insert a row without a date/time stamp. shouldn't matter if you have the column in your tree or not. It'd be a table restriction wouldn't it?

    Perhaps, if possible you want to change the column def to accept nulls.

    jvanboga
    Just curious, what is the diff between geting the system date in the map and letting DB2 code doing it?
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 3.  Re: Insert into DB2 - TIMESTAMP NOT NULL DEFAULT CURRENT TIMESTAMP

    Posted Thu August 31, 2006 10:50 AM

    Originally posted by: DianeC


    We map to databases often here. As long as a field is defined in the table as NULL = N, or NOT NULL, you can not insert a row into that table without inserting something into that field. You need to either change the definition in the table or add that field to the type tree as a required field and populate it in the map.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender