Skip to Content
avatar image
Former Member

How to update the table when one of the column (CreateDate) field is equal to NULL.

Hi SAP Experts,

We have interface message flowing from MDM system to PI to Data Base (IMB DB2) scenario. we are using UPDATE statement to update the table (AGE_GRP_CATEG) when one of column (CreateDate) field is equal to NULL.

1. PI JDBC adapter is forming the query like "UPDATE AGE_GRP_CATEG SET CreateDate ='2017/04/11 10:10:10.0' WHERE CreateDate = NULL" but this query is not selecting any records even there are records in the DB.

2. When we checked with DB Admin, they have informed that where clause should be like " .. WHERE CreateDate IS NULL", then only query would returns the records, it will not work with CreateDate = NULL.

3. Because of this issue, JDBC adapter is not updating the records as expected and its causing lot of issues for integration testing.

we did not find any SAP Notes or SAP link, on forming the where clause as "CreateDate IS NULL". Please provide any SAP link/Notes on this topic and inputs to resolve this issue.

We do not want to use java code or any lookups for this functionality. Kindly let us know if this can be done without these.

Thanks,

Mohammed Raffi

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Apr 13, 2017 at 11:17 AM

    Hi Mohammed,

    The problem you described is not related to SAP, it's related to SQL.

    Please check the below link for details about "IS NULL" and "IS NOT NULL".

    https://www.w3schools.com/sql/sql_null_values.asp

    Note that when you work with SAP tables and you look for NULL values then you should check two conditions:

    WHERE field_name IS NULL OR field_name = ' '   # check if it's a SPACE character

    Regards,

    Andrzej

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 13, 2017 at 11:41 AM

    Hi Mohhamed!

    You can achieve desired functionality using "SQL_QUERY"/"SQL_DML" action type:

    https://help.sap.com/saphelp_nwpi711/helpdata/en/44/7b7855fde93673e10000000a114a6b/content.htm

    The last example in given document is exactly what you need.

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded