Monday, June 11, 2007

Find data in Oracle databases

If you ever need to find that elusive information in an oracle database to load into TM1 via TI, then the following sql is very useful:

SELECT * FROM ALL_TAB_COLUMNS
WHERE OWNER = ''

SELECT * FROM ALL_TAB_COLUMNS
WHERE COLUMN_NAME LIKE '% %'

SELECT * FROM ALL_TAB_COLUMNS
WHERE table_name= ''

Basically you can use the ALL_TAB_COLUMNS table to find info on all the tables in an oracle database. i.e. you know there is a table that holds GST info but you are not sure where, then execute the sql:

SELECT * FROM ALL_TAB_COLUMNS
WHERE COLUMN_NAME LIKE '%GST%'

I would also recommend that anyone who needs to get data out of Oracle uses the tool Toad, which I find invaluable.