Fixed concatinate function to cast both sides as a VARCHAR, since DB2 and Derby disallow parameters on both sides of the function.

git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@497190 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Marc Prud'hommeaux 2007-01-17 21:48:27 +00:00
parent c7128669c7
commit ef67680a55
1 changed files with 4 additions and 0 deletions

View File

@ -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})";