Uploaded image for project: 'Hibernate ORM'
  1. Hibernate ORM
  2. HHH-11557

DB2 gets confused with numerical parameters in nullif function DB2Dialect

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.2.8
    • Fix Version/s: 5.2.10
    • Component/s: hibernate-core
    • Labels:
      None
    • Environment:
      DB2 on z/OS, JDBC-Driver 4.19.66

      Description

      While using DB2390Dialect a call of the function getSelectClauseNullString in DB2Dialect returns "nullif(0,0)" in default case. The database returns the following error:
      Error: DB2 SQL Error: SQLCODE=-170, SQLSTATE=42605, SQLERRMC=NULLIF, DRIVER=4.13.80
      SQLState: 42605
      ErrorCode: -170

      The meaning of SQLCODE -170 is: THE NUMBER OF ARGUMENTS SPECIFIED FOR function-name IS INVALID

      (0,0) isn't interpreted as two parameters.

      The solution is to insert a trailing space after the comma. Inserting the space is syntactically correct in general. So this has no negativ impact on the other sqlTypes.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified