Home » RDBMS Server » Server Administration » Dynamically build Columns for a SQL select
Dynamically build Columns for a SQL select [message #370888] Wed, 01 March 2000 02:31
Ajay Madan
Messages: 8
Registered: January 2000
Junior Member
My application is on Oracle8i/Developer6. The table I am accessing(thru the form, in one of the triggers) has 130 columns and I need to display only 3 of those columns on the form. These 3 columns are not fixed. It could be any of the 3 columns amongst the 130 columns based on some condition. All the columns have the same prefix, but only the suffix changes. For example the columns names are RQMT1, RQMT2..........RQMT130. Is it possible that I hardcode the 'RQMT' in the query and substitute 1 or 2 or any number based on my condition.

select RQMT&num,
RQMT&NUM1,
RQMT&NUM2
INTO LOCAL_VARS

FROM
TABLE_NAME
WHERE <SOME CONDITION>

Or can you suggest some solution for dynamic building of the SQL statement?
Previous Topic: Locks on Tables
Next Topic: oracle optimiser
Goto Forum:
  


Current Time: Thu Apr 18 18:49:57 CDT 2024