Search This Blog

Wednesday, 5 August 2015

Oracle query to fetch table columns name

SELECT TBL.OWNER, TBL.TABLE_NAME, TBL.COLUMN_NAME, TBL.DATA_TYPE, TBL.DATA_LENGTH, TBL.COLUMN_ID, '  *---------* ' NEXT_ALL_TABLE_DATA
        ,TBL.*
FROM ALL_TAB_COLUMNS TBL
WHERE 1=1
AND COLUMN_NAME =       'COLUMN_NAME'
AND OWNER       =       'SCHEMA_NAME'
--TABLE_NAME='MyTableName'
ORDER BY TBL.COLUMN_ID ASC

No comments:

Post a Comment