I wrote a PLSQL program that generates a table that usually has more than 200 columns. The number of columns is not fixed and changes each time the plsql procedure is executed. I always need to select not all columns, but it is cumbersome to add them to the SELECT query manually. The columns that I don’t need to select are columns1, columns2 and columns3 each 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 search for column names from user_tab_colums (system view) for this table and create this SQL query. Is there an easier way to achieve the same sql? I usually write a SELECT table. * FROM table; if I want to see all the columns. Is there a way to use similar syntax to say that SELECT is all, but not table.col1, table.col2, table.col3 FROM table ;?
source
share