Re: Dynamically build the column names for the SELECT query

From: Marc <E.Mail_at_address.com>
Date: 2000/03/01
Message-ID: <89ieei$j7r$1_at_vkhdsu24.hda.hydro.com>#1/1


If all columns are of the same type, you can set the Query Data Source Type property of your block to QUERY and use following statement to change your query:

Set_Block_Property('yourblock', QUERY_DATA_SOURCE_NAME, 'dynamically created select');

Another solution might be to use package EXECSQL in combination with ON-SELECT and ON-FETCH triggers.

Marc

Ajay Madan wrote in message <13b2087d.3eb8866c_at_usw-ex0109-070.remarq.com>...
>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 whatever my conditions are.
>
> 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?
>
>
>* Sent from AltaVista http://www.altavista.com Where you can also find
related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful Received on Wed Mar 01 2000 - 00:00:00 CET

Original text of this message