Skip to content

Commit

Permalink
added 2000, 2005 and 2008 to the list of compatible db types
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed May 22, 2014
1 parent a51626f commit e65a928
Showing 1 changed file with 12 additions and 10 deletions.
Expand Up @@ -64,8 +64,7 @@ public enum Format {
};

public enum Compatible {
DB2, DERBY, FIREBIRD, GREENPLUM, H2, HSQLDB, HSQLDB2, INFORMIX, INTERBASE,
MSSQL, MYSQL, ORACLE, POSTGRES, SYBASE, SQLITE, MARIADB, ASE, SQLANYWHERE
DB2, DERBY, FIREBIRD, GREENPLUM, H2, HSQLDB, HSQLDB2, INFORMIX, INTERBASE, MSSQL, MSSQL2000, MSSQL2005, MSSQL2008, MYSQL, ORACLE, POSTGRES, SYBASE, SQLITE, MARIADB, ASE, SQLANYWHERE
};

private Format format = Format.SQL;
Expand Down Expand Up @@ -445,15 +444,17 @@ protected void startTable(Table table) {
csvWriter.setUseTextQualifier(true);
csvWriter.setForceQualifier(true);
} else if (format == Format.SQL) {
if (table.getCatalog() != null && table.getCatalog().equals(platform.getDefaultCatalog())) {
if (table.getCatalog() != null
&& table.getCatalog().equals(platform.getDefaultCatalog())) {
table.setCatalog(null);
}
if (table.getSchema() != null && table.getSchema().equals(platform.getDefaultSchema())) {
table.setSchema(null);
if (table.getSchema() != null
&& table.getSchema().equals(platform.getDefaultSchema())) {
table.setSchema(null);
}
Table targetTable = table.copy();
insertSql = DmlStatementFactory.createDmlStatement(
compatible.toString().toLowerCase(), DmlType.INSERT, targetTable, useQuotedIdentifiers);
insertSql = DmlStatementFactory.createDmlStatement(compatible.toString()
.toLowerCase(), DmlType.INSERT, targetTable, useQuotedIdentifiers);
}

if (!noCreateInfo) {
Expand All @@ -466,7 +467,8 @@ protected void startTable(Table table) {
}
}

writeComment("DbExport: " + StringUtils.defaultString(IoVersion.getVersion().version()));
writeComment("DbExport: "
+ StringUtils.defaultString(IoVersion.getVersion().version()));
writeComment("Catalog: " + StringUtils.defaultString(getCatalogToUse()));
writeComment("Schema: " + StringUtils.defaultString(getSchemaToUse()));
writeComment("Table: " + table.getName());
Expand Down Expand Up @@ -510,8 +512,8 @@ protected void writeRow(Row row) {
if (format == Format.CSV) {
csvWriter.writeRecord(values, true);
} else if (format == Format.SQL) {
write(insertSql.buildDynamicSql(BinaryEncoding.HEX, row,
useVariableDates, useJdbcTimestampFormat), "\n");
write(insertSql.buildDynamicSql(BinaryEncoding.HEX, row, useVariableDates,
useJdbcTimestampFormat), "\n");

} else if (format == Format.XML) {
write("\t<row>\n");
Expand Down

0 comments on commit e65a928

Please sign in to comment.