Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Issues when trying to Query Column Names

1008191May 10 2013 — edited May 10 2013
Scenario : 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 7 2013
Added on May 10 2013
5 comments
409 views