db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Einsle <rob...@einsle.de>
Subject Error while Reading Model from Database
Date Tue, 31 Jul 2007 07:46:12 GMT
Hy List,

i've an Error, reading the Model from Database. We're using DB2 and the
stack-Trace is:

--- cut ---
Caused by: com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -204,
SQLSTATE: 42704, SQLERRMC: TFPEIN.AF01T02
    at com.ibm.db2.jcc.c.tf.e(tf.java:1680)
    at com.ibm.db2.jcc.c.tf.a(tf.java:1239)
    at com.ibm.db2.jcc.b.jb.h(jb.java:139)
    at com.ibm.db2.jcc.b.jb.a(jb.java:43)
    at com.ibm.db2.jcc.b.w.a(w.java:30)
    at com.ibm.db2.jcc.b.cc.f(cc.java:161)
    at com.ibm.db2.jcc.c.tf.n(tf.java:1219)
    at com.ibm.db2.jcc.c.tf.a(tf.java:1958)
    at com.ibm.db2.jcc.c.tf.a(tf.java:523)
    at com.ibm.db2.jcc.c.tf.executeQuery(tf.java:507)
    at
org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
    at
org.apache.ddlutils.platform.JdbcModelReader.determineAutoIncrementFromResultSetMetaData(JdbcModelReader.java:1064)
    at
org.apache.ddlutils.platform.db2.Db2ModelReader.readTable(Db2ModelReader.java:101)
    at
org.apache.ddlutils.platform.JdbcModelReader.readTables(JdbcModelReader.java:516)
    at
org.apache.ddlutils.platform.JdbcModelReader.getDatabase(JdbcModelReader.java:472)
    at
org.apache.ddlutils.platform.PlatformImplBase.readModelFromDatabase(PlatformImplBase.java:1920)
    ... 4 more
--- cut ---

DDL-Utils creates here an SQL-Statement:

--- cut ---
SELECT  <COLUMNS> FROM <TABLE> WHERE 1 = 0
--- cut ...

but i think, this is wrong, i muss the Database-Schema. The correct
Statement should be:

--- cut ---
SELECT  <COLUMNS> FROM <SCHMEA>.<TABLE> WHERE 1 = 0
--- cut ...

If i append the 2 Lines:

--- cut ---
        query.append(" FROM ");
        if (getPlatform().isDelimitedIdentifierModeOn())
        {
            query.append(getPlatformInfo().getDelimiterToken());
        }
        query.append(table.getSchema());
        query.append(".");
        query.append(table.getName());
        if (getPlatform().isDelimitedIdentifierModeOn())
        {
            query.append(getPlatformInfo().getDelimiterToken());
        }
        query.append(" WHERE 1 = 0");

--- cut ---


(table.getSchema() and . appended) then its working.

I think, this is a Bug.

Robert


Mime
View raw message