Issues when trying to Query Column Names
1008191May 10 2013 — edited May 10 2013Scenario : I want to query the column names of a table . I am using the below Query.
SELECT column_name FROM all_tab_cols where table_name ='PT_TYPES';
Problem : when i run the above query it is returning me 43 rows - but my table really contains only 3 rows (ID, NAME, PRODUCT_TYPE_CODE) and out of 43 rows returned it contains duplicate entries & column names from other tables too .
why this is happening ? is there is anyway to find column names from table without this issue ?
when i run the below query on same table PT_TYPES it returns me 13 rows with 3 columns (ID, NAME, PRODUCT_TYPE_CODE) which is correct
SELECT * FROM PRODUCT_TYPES