Skip to content

Commit

Permalink
0004580: SQL Server bulk loader data conversion with decimal scientific
Browse files Browse the repository at this point in the history
notation
  • Loading branch information
erilong committed Oct 19, 2020
1 parent 6ccb2c1 commit f5d8971
Showing 1 changed file with 14 additions and 0 deletions.
Expand Up @@ -23,6 +23,7 @@
import static org.apache.commons.lang.StringUtils.isBlank;
import static org.apache.commons.lang.StringUtils.isNotBlank;

import java.sql.Types;
import java.util.HashMap;

import org.apache.commons.lang.StringUtils;
Expand Down Expand Up @@ -366,6 +367,19 @@ protected String getColumnSize(Table table, Column column) {
return column.getSize();
}

@Override
protected boolean useTriggerTemplateForColumnTemplatesDuringInitialLoad(Column column) {
boolean result = super.useTriggerTemplateForColumnTemplatesDuringInitialLoad(column);
if (column != null) {
int type = column.getJdbcTypeCode();
if (type == Types.DECIMAL || type == Types.FLOAT || type == Types.DOUBLE) {
// always use template for decimal to avoid conversion to scientific notation
result = true;
}
}
return result;
}

@Override
protected boolean requiresEmptyLobTemplateForDeletes() {
return true;
Expand Down

0 comments on commit f5d8971

Please sign in to comment.