I have written PLSQL program that generates table having usually more than 200 columns.
It’s number of columns is not fixed and it changes every time plsql procedure is executed.
I always need to SELECT not all the columns but it is cumbersome to add them into SELECT query by hand. The columns that I don’t need to select are column1, column2 and column3 every time. IF I have 200 columns I need to write
Select column4, column5, ..., column200 from plsqltable
My solution is to use another PLSQL program to look for column names from user_tab_colums (system view) for that table and compose that sql query. Is there some simpler way to achieve the same sql? Usally I write SELECT table.* FROM table; if I want to see all columns. Is there a way to use similar syntax to say that SELECT all but not table.col1, table.col2, table.col3 FROM table;?
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:766825833740
so this is what I did, and you shouldn’t need a second procedure to do this; you can do it right in your main procedure: