how do you count the number of columns in a table in oracle?
SELECT count(*) FROM user_tab_columns WHERE table_name = 'FOO'
should give you the number of columns in foo. You can obtain quite a bit of information from USER_TAB_COLUMNS and USER_TABLES (there are also ALL_ and DBA_ variants).
USER_TAB_COLUMNS
USER_TABLES
ALL_
DBA_