#1113 trunk DB2SqlImpl getViewSourceSql() iseries jt/400

Snapshot
open
nobody
None
5
2015-01-08
2013-12-02
No

case OS400:
result ="select mqt_definition " + "from qsys2.systables " + "where table_schema = ? " + "and table_name = ? ";

but there is no mqt_definiton for simple views

sql for simple views should be:

result="select view_definition from qsys2.sysviews where table_schema=? and table_name=?";

maybe pass isMQT-parm to function getViewSourceSql()

Discussion

  • for the moment i changed:

    TableSourceTab.java:

    //TODO tshvr4 if isMQT maybe new method getMQTSourceSql()
    {
    // MQTs only ever have one sql statement
    sql="select mqt_definition from qsys2.systables where table_schema=? and table_name=?";//tshvr4 added
    super.appendSeparator = true;
    }

    DB2SqlImpl.java:

    switch(db2Type) {
        case OS400:
            /************
            tshvr4
            result = 
                    "select mqt_definition " + 
                    "from qsys2.systables " + 
                    "where table_schema = ? " + 
                    "and table_name = ? ";
            ****************/
            result="select view_definition from qsys2.sysviews where table_schema=? and table_name=?";//tshvr4
            break;
    

    Maybe define new function getMQTSourceSql in interface?