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

Home -> Community -> Usenet -> c.d.o.server -> Re: How to accessing columns of a query-result by index

Re: How to accessing columns of a query-result by index

From: Henner Hucke <hehu_at_freenet.de>
Date: 20 Sep 2005 18:06:04 GMT
Message-ID: <Xns96D7CB4A8BABFHuckeHennerAtAthlet@127.0.0.1>


jmayer_at_ratundtat.com wrote in news:1127207242.558470.103050 @g44g2000cwa.googlegroups.com:

> Hi there!
>
> In PL/SQL, I want to access the columns of my resultset by index. I'm
> dreaming of something like this:
>
> for rec_data in cursor (select * from postal_address) loop
>
> -- examining the structure of the resultset:
> for i in 1..rec_data%colcount loop
>
> dbms_output.putline(rec_data%column(i));
>
> end loop;
>
> end loop;
>
> To avoid misunderstandings: the expressions "rec_data%colcount" and
> rec_data%column(i) are only existing in my fantasy, i just want to know
> if it's possible to examine the unkown structure of resultset to handle
> the resultset in a dynamic way.
>
> Any ideas ?
>
> Using Oracle 9i, release 9.2.0.3.0
>
> Jens
>

Hi Jens,

it is not PL/SQL and may not help you, but with a java stored procedure you can do it very similar as you pseudo code (java.sql.ResultSet.getMetaData()).

hth Henner Received on Tue Sep 20 2005 - 13:06:04 CDT

Original text of this message

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