Skip to Main Content

SQL & PL/SQL

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!

selecting only essential columns from user_tab_columns table

500237Jan 14 2010 — edited Jan 14 2010
Hi All,

How to select onlt those columns from all_tab_columns table for a particular table say 'TAB' excluding few columns.

e.g. A table 'TAB' from USE_TAB_COLUMNS

required columns only co1,col2,col3
not required col4,col5

How to write a query to select only required columns excluding those not requd.

SELECT column_name FROM USER_TAB_COLUMNS
WHERE table_name='TAB'
AND column_name ....... not in/exist???

Actually I need to write a dynamic query based on the i/p parameter which is going to be table_name for the procedure.

something like

-------------------------------------------------------------------------------------
procedure proc_abc
( ip_tab_name varchar2)

begin

SELECT column_name FROM USER_TAB_COLUMNS
WHERE table_name='TAB'
AND column_name ....... not in/exist???

end;
-------------------------------------------------------------------------------------
Please help...


Rgds,
Aashish
This post has been answered by 737819 on Jan 14 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 11 2010
Added on Jan 14 2010
23 comments
2,996 views