JOIN SELECT TRIM(TRAILING FROM T1.tabname),'|', TRIM(TRAILING FROM T2.tabname),'|', TRIM(TRAILING FROM T1.tabname) || '.' || TRIM(TRAILING FROM C1.colname) || ' = ' || TRIM(TRAILING FROM T2.tabname) || '.' || TRIM(TRAILING FROM C2.colname), '|', ' ', '|' FROM systables T1 , systables T2 , syscolumns C1, syscolumns C2 WHERE T1.tabid=C1.tabid AND T2.tabid=C2.tabid AND C1.coltype IN (0,11,12,13,14,256,267,268,269,270,1,2,3,4,5,6,8,257,258,259,260,261,262,264,7,10,263,266) AND C1.coltype = C2.coltype AND C1.colname = C2.colname AND T1.tabid > T2.tabid AND T1.tabid >= 100 ORDER BY 1 OBJECT SELECT TRIM(TRAILING FROM systables.tabname),'|', TRIM(TRAILING FROM syscolumns.colname),'|', TRIM(TRAILING FROM systables.tabname),'|', TRIM(TRAILING FROM syscolumns.colname),'|', TRIM(TRAILING FROM systables.tabname) || '.' || TRIM(TRAILING FROM syscolumns.colname),'|', ' ','|', 'A','|', ' ','|' FROM systables,syscolumns WHERE systables.tabtype IN ('T','V','P','S') AND systables.tabid = syscolumns.tabid AND systables.tabid >= 100 AND syscolumns.coltype IN (0,11,12,13,14,256,267,268,269,270) UNION SELECT TRIM(TRAILING FROM systables.tabname),'|', TRIM(TRAILING FROM syscolumns.colname),'|', TRIM(TRAILING FROM systables.tabname),'|', TRIM(TRAILING FROM syscolumns.colname),'|', TRIM(TRAILING FROM systables.tabname) || '.' || TRIM(TRAILING FROM syscolumns.colname),'|', ' ','|', 'N','|', ' ','|' FROM systables,syscolumns WHERE systables.tabtype IN ('T','V','P','S') AND systables.tabid = syscolumns.tabid AND systables.tabid >= 100 AND syscolumns.coltype IN (1,2,3,4,5,6,8,257,258,259,260,261,262,264) UNION SELECT TRIM(TRAILING FROM systables.tabname),'|', TRIM(TRAILING FROM syscolumns.colname),'|', TRIM(TRAILING FROM systables.tabname),'|', TRIM(TRAILING FROM syscolumns.colname),'|', TRIM(TRAILING FROM systables.tabname) || '.' || TRIM(TRAILING FROM syscolumns.colname),'|', ' ','|', 'D','|', ' ','|' FROM systables,syscolumns WHERE systables.tabtype IN ('T','V','P','S') AND systables.tabid = syscolumns.tabid AND systables.tabid >= 100 AND syscolumns.coltype IN (7,10,263,266) UNION SELECT TRIM(TRAILING FROM systables.tabname),'|', TRIM(TRAILING FROM syscolumns.colname),'|', TRIM(TRAILING FROM systables.tabname),'|', TRIM(TRAILING FROM syscolumns.colname),'|', TRIM(TRAILING FROM systables.tabname) || '.' || TRIM(TRAILING FROM syscolumns.colname),'|', ' ','|', 'A','|', ' ','|' FROM systables,syscolumns,syssyntable WHERE syssyntable.servername = '' AND syssyntable.dbname = '' AND syssyntable.owner = '' AND syssyntable.tabname = '' AND systables.tabid = syssyntable.tabid AND syscolumns.tabid = syssyntable.btabid AND syscolumns.coltype IN (0,11,12,13,14,256,267,268,269,270) UNION SELECT TRIM(TRAILING FROM systables.tabname),'|', TRIM(TRAILING FROM syscolumns.colname),'|', TRIM(TRAILING FROM systables.tabname),'|', TRIM(TRAILING FROM syscolumns.colname),'|', TRIM(TRAILING FROM systables.tabname) || '.' || TRIM(TRAILING FROM syscolumns.colname),'|', ' ','|', 'N','|', ' ','|' FROM systables,syscolumns,syssyntable WHERE syssyntable.servername = '' AND syssyntable.dbname = '' AND syssyntable.owner = '' AND syssyntable.tabname = '' AND systables.tabid = syssyntable.tabid AND syscolumns.tabid = syssyntable.btabid AND syscolumns.coltype IN (1,2,3,4,5,6,8,257,258,259,260,261,262,264) UNION SELECT TRIM(TRAILING FROM systables.tabname),'|', TRIM(TRAILING FROM syscolumns.colname),'|', TRIM(TRAILING FROM systables.tabname),'|', TRIM(TRAILING FROM syscolumns.colname),'|', TRIM(TRAILING FROM systables.tabname) || '.' || TRIM(TRAILING FROM syscolumns.colname),'|', ' ','|', 'D','|', ' ','|' FROM systables,syscolumns,syssyntable WHERE syssyntable.servername = '' AND syssyntable.dbname = '' AND syssyntable.owner = '' AND syssyntable.tabname = '' AND systables.tabid = syssyntable.tabid AND syscolumns.tabid = syssyntable.btabid AND syscolumns.coltype IN (7,10,263,266) ORDER BY 1