selecting only essential columns from user_tab_columns table
500237Jan 14 2010 — edited Jan 14 2010Hi 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