Skip to content
Permalink
Browse files

0002152: DDL errors on DB2 i5 AS/400

  • Loading branch information...
chenson42 committed Jan 29, 2015
1 parent 7a7b0e0 commit 781503e263e021655d54f41980455df292b02687
@@ -25,6 +25,11 @@ protected String getTrueValue() {
return "YES";
}

@Override
protected String getSysColumnsDefaultValueColumn() {
return "DFTVALUE";
}

@Override
protected String getSysColumnsSchemaColumn() {
return "DBNAME";
@@ -66,6 +66,10 @@ public Db2DdlReader(IDatabasePlatform platform) {
protected String getSysColumnsSchemaColumn() {
return "TBCREATOR";
}

protected String getSysColumnsDefaultValueColumn () {
return "DEFAULTVALUE";
}

@Override
protected Table readTable(Connection connection, DatabaseMetaDataWrapper metaData,
@@ -84,7 +88,7 @@ protected Table readTable(Connection connection, DatabaseMetaDataWrapper metaDat
log.debug("about to read additional column data");
/* DB2 does not return the auto-increment status via the database
metadata */
String sql = "SELECT NAME, IDENTITY, DEFAULT, DFTVALUE FROM " + systemSchemaName + ".SYSCOLUMNS WHERE TBNAME=?";
String sql = "SELECT NAME, IDENTITY, DEFAULT, "+getSysColumnsDefaultValueColumn()+" FROM " + systemSchemaName + ".SYSCOLUMNS WHERE TBNAME=?";
if (StringUtils.isNotBlank(metaData.getSchemaPattern())) {
sql = sql + " AND "+getSysColumnsSchemaColumn()+"=?";
}

0 comments on commit 781503e

Please sign in to comment.
You can’t perform that action at this time.