Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: filedname as variable in dbms_outpu

Re: filedname as variable in dbms_outpu

From: Detlef Kandziora <kancom_at_bigfoot.com>
Date: Wed, 06 Dec 2000 23:32:02 GMT
Message-ID: <3a2ecb39.48718593@news.arcor-ip.de>

Betreff:              Re: filedname as variable in dbms_outpu
Datum:              Wed, 06 Dec 2000 17:11:19 +0100
 Von:              "Detlef Kandziora" <kancom_at_bigfoot.com>
 Rückantwort:     kancom_at_bigfoot.com
 An:              Markus Schwabe <mschwabe_at_gscout.de>, 

Hi Markus,

Thank you for this info ! Yes, you are certainly right, as I heard today from Oracle-Support as well.

So I see now 3 possibilities:

  1. write a long list of statements per each column
    • that's what I do now, but in fact, if I had only 10 columns to play with, I wouldn't have ask sombeody. I do have 48 at this time, but it will become more according to new version of that information-service wich delivers that data.
  2. using an external procedure of C++ or something like that (unfortunately I have no experience with that)
  3. Using dynamic SQL (= built in pakcage DBMS_SQL) which can also generate dynamic PL/SQL-Blocks (unfortunately this is pretty komplex stuff and I will certainly break my fingers while coding that stuff)

        best regards Detlef

>Betreff:
> Re: fieldname as variable in dbms_outpu
> Datum: Wed, 06 Dec 2000 12:34:29 +0100
> Von: Markus Schwabe <mschwabe_at_gscout.de>
> An: Detlef Kandziora <kancom_at_bigfoot.com>
>
>Hi,
>
>sorry, no way. You can not handle a Column-name like a content of a
>variable.
>Forget the loop and write down ten times dbms_output.
>(if you get another answer (and this works), then feel free to correct
>me.)
>
>Markus
>
>On Wed, 06 Dec 2000 00:10:08 GMT, kancom_at_bigfoot.com (Detlef
>Kandziora) wrote:
>
>>Hi,
>>
>>I want to display the content of a list of fields, but in something
>>like a for - loop.
>>
>>The table has numbered columns (filed1...filed10)
>>
>>I generate a variable for the filednames and catch all contents of the
>>tabel in a record (with rowtype%).
>>
>>I've done a simple Loop like this:
>>
>>
>>for i in 1..10 loop
>> f_nam :='field'||i;
>> dbms_output.put_line (f_name);
>>end loop;
>>
>>This shows only the fieldnames, but I need the field-content from the
>>rec_tab, but I can't do something like this (it's the same useless
>>thing than above):
>>
>>for i in 1..10 loop
>> f_nam :='rec_tab.field'||i;
>> dbms_output.put_line (f_name);
>>end loop;
>>
>>Isn'r there something like a content-function for a variable ?
>>
>>thanks for any tip Detlef
>>
>>P.S.: Please reply only to mail-adress ! I can't access news-groups in
>>the office, but will post the answers later
>
Received on Wed Dec 06 2000 - 17:32:02 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US