Re: dumb sql question
Posted in 1993
} ->From: Matthew Mashyna <mm5l+@andrew.cmu.edu> } Matt, } } Ain't no such thing as a dumb question. If you learn from it, it's not dumb. } Just remember: "Ignorance can be cured, but stupid is forever." } } Anyway, try these: } } SELECT tabname FROM systables } WHERE NOT tabname MATCHES "sys*" { to not print the system catalog tables } } ORDER BY tabname } ; } SELECT tabname table_name, colname column_name, colno column_order } FROM systables t, syscolumns c } WHERE t.tabid = c.tabid } AND NOT tabname MATCHES "sys*" { to not print the system catalog tables } } ORDER BY tabname, colno } ; } Regards, } Alan } +------------------------------+---------------------------------------+ } | R. Alan Popiel | Internet: alan@den.mmc.com | } +------------------------------+---------------------------------------+ Something to note. Most SQL databases use this scheme, but they are not identical in how they lay out there tables and columns and indexes, etc. In the case of Informix, you can make an assumption on tabid. If you chance the "NOT tabname MATCHES 'sys*'" to "tabid > 99" then you'll skip all of the system tables and find any tables that happen to be named "sys*". Luck, Will (uunet!la4gen!villy)