Skip to Content
avatar image
Former Member

How to insert a NULL value in SQL using JDBC Adapter

Hi All,

I have a File -> JDBC scenario.

In the File and in the SQL table I have a column called "MR_DATE" that needs to be mapped

I have to do the following:

If MR_DATE is NOT equal to "00000000"

then pass MR_DATE to SQL table

else

set the MR_DATE column in the table as NULL.

Please suggest

regards,

Piyush

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jun 16, 2010 at 09:01 AM

    Hi Piyush,

    In the receiver JDBC adapter select the option Interpretation of Empty String Values as NULL.

    Pass date as empty, it will be interpreted as NULL by adapter and inserted in database.

    Regards,

    Gautam Purohit

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      What about if you want to insert empty string values for other fields (besides the nulls for that particular field)?

  • avatar image
    Former Member
    Jun 16, 2010 at 10:36 AM

    I solved this by using the "If" block.

    It does not create the target node if date is 00000000.

    Add comment
    10|10000 characters needed characters exceeded