Re: using for loop to read the field values

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 27 Feb 2003 07:53:07 -0800
Message-ID: <2687bb95.0302270753.797cfb64_at_posting.google.com>


saroj_vtha_at_yahoo.com (SV) wrote in message news:<bb4abd8a.0302261037.6d07b527_at_posting.google.com>...
> Hello,
> I have an oracle table which has 101 fields in the format:
>
> id val1 val2 val3.............val100
>
> I would like to use the select statement for different ids and print
> the values.
> But instead of manually using the dbms_output.put_line for each of the
> 100 values, is it possible to print it out through a for loop.
> Any suggestion would be appreciated

Basically, you will have to code the 100 column names one way or the other. You could read each row into a plsql table and then use a for loop to print each plsql table value. This would save typing on creating the dbms_output, but to load the plsql table you will have to reference all 101 columns by name.

If you will need to access the row data and use the columns repeatedly then writing one plsql stored/packaged procedure and passing a plsql table to various routines might be a read code saver down the line.

IMHO -- Mark D Powell -- Received on Thu Feb 27 2003 - 16:53:07 CET

Original text of this message