Unix Technical Forum

Loop trough row or get info on row or cursor

This is a discussion on Loop trough row or get info on row or cursor within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Hello What kind of information is possible to get from a cursor or a rowtype in oracle pl/sql. I ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-07-2008, 09:25 AM
Tim Gahnstroem
 
Posts: n/a
Default Loop trough row or get info on row or cursor

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-07-2008, 09:26 AM
Mark D Powell
 
Posts: n/a
Default Re: Loop trough row or get info on row or cursor

tim.gahnstroem@cern.ch (Tim Gahnstroem) wrote in message news:<c2fd55f1.0308140003.560efef9@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 --
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:05 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com