Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
0004136: Oracle character set problem with "value too large for column"
  • Loading branch information
erilong committed Oct 30, 2019
1 parent 9db3e7a commit 72ab1ab
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -404,9 +404,11 @@ protected Object getObjectValue(String value, Column column, BinaryEncoding enco
String charValue = value.toString();
if ((StringUtils.isBlank(charValue) && getDdlBuilder().getDatabaseInfo().isBlankCharColumnSpacePadded())
|| (StringUtils.isNotBlank(charValue) && getDdlBuilder().getDatabaseInfo().isNonBlankCharColumnSpacePadded())) {
if (column.getCharOctetLength() == 0 || column.getSizeAsInt() == column.getCharOctetLength()) {
if (column.getSizeAsInt() != column.getCharOctetLength()) {
// using multiple-byte character set, the size is maximum number of characters
objectValue = StringUtils.rightPad(charValue, column.getSizeAsInt(), ' ');
} else {
// single-byte character set or field defined as number of bytes
objectValue = charValue + StringUtils.repeat(" ", column.getCharOctetLength() - value.getBytes().length);
}
}
Expand Down

0 comments on commit 72ab1ab

Please sign in to comment.