We're updating the issue view to help you get more done. 

DB2 gets confused with numerical parameters in nullif function DB2Dialect

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.

Environment

DB2 on z/OS, JDBC-Driver 4.19.66

Status

Assignee

Unassigned

Reporter

Martin Tröger

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

Yes, likely

Requires Release Note

None

backportDecision

None

Components

Affects versions

5.2.8

Priority

Major