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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Loop trough row or get info on row or cursor

Re: Loop trough row or get info on row or cursor

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 14 Aug 2003 06:31:31 -0700
Message-ID: <2687bb95.0308140531.2dfb6bca@posting.google.com>


tim.gahnstroem_at_cern.ch (Tim Gahnstroem) wrote in message news:<c2fd55f1.0308140003.560efef9_at_posting.google.com>...
> Hello
>
> What kind of information is possible to get from a cursor or a rowtype
> in oracle pl/sql. I want to display information about a object on a
> webpage, al information, in one column. The information is stored in
> one row in one table.
>
> I could of course reference all column names and display the
> information from one at the time but this gives some disadvantages.
> First of all, if a column is removed from the table in the future, the
> program will crash.
> Second, if a column is added it will not be displayed and no notice
> given. So a good thing would be if I could loop trough the table
> sideways in some way or if I at least could get information about how
> many columns exist (it is not likely that one column will be removed
> but perhaps one will be added).
>
> I don't think this is possible in oracle any information (or pointer
> to a good webpage) about what info I can get out of a cursor or row
> would be appreciated.
>
> Thanks a lot
>
> Tim

Tim, It could just be my reading of your post, but I found it to be confusing and I am not really sure what you want to do.

Information about objects created within the database exist in the rdbms dictionary tables. In this case all_tab_columns would provide a list of the existing columns at the time of the inquery. Using plsql it would be very easy to concatenate each column name into a single varchar variable since the maximum number of columns in a table times the maximum column length of 30 is less than 32k.

There have been numerous posts on this forum on converting rows into columns that you could also search on. Look for the term: pivot table. The asktom site also has information on this task.

HTH -- Mark D Powell -- Received on Thu Aug 14 2003 - 08:31:31 CDT

Original text of this message

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