Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Advanced Dynamic SQL (at least to me)
John Hunter wrote:
> Hi Gang,
>
> I'm having a hard time trying to find a means to substitue table values that
> maps fields
> to a query:
>
> Ie.
>
> Table_map
> type field_nmbr field_name
> 1 1 field2
> 1 3 field1
> 2 1 field3
>
> Table_map_layout
> field_nmbr field_start field_end
> 1 1 3
> 2 4 6
> 3 7 9
>
> Table_records
> field1 field2 field3 field4
> aaa bbb ccc ddd
>
> so given the above schema I want to be able to output to a string
> the values in Table_records as follows:
>
> if type = 1
> string = 'bbb ccc'
>
> if type = 2
> string = 'ccc '
>
> Is this at all clear? I'll try to clarify if needed.
>
> Thanks alot for your help, and no, this is not for an exam ;-)
> -John
If it is clear ... use DECODE.
If not ... try to clarify your request.
Daniel A. Morgan Received on Thu May 10 2001 - 23:26:22 CDT