diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractDB2Dictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractDB2Dictionary.java index 22af396ea..5000e8ac3 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractDB2Dictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/AbstractDB2Dictionary.java @@ -31,9 +31,13 @@ public abstract class AbstractDB2Dictionary longVarbinaryTypeName = "BLOB"; varbinaryTypeName = "BLOB"; + // DB2-based databases have restrictions on having uncast parameters + // in string functions toUpperCaseFunction = "UPPER(CAST({0} AS VARCHAR(1000)))"; toLowerCaseFunction = "LOWER(CAST({0} AS VARCHAR(1000)))"; stringLengthFunction = "LENGTH(CAST({0} AS VARCHAR(1000)))"; + concatenateFunction = "(CAST({0} AS VARCHAR(1000)))||" + + "(CAST({1} AS VARCHAR(1000)))"; trimLeadingFunction = "LTRIM({0})"; trimTrailingFunction = "RTRIM({0})";