Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to check all columns existing in a table?

829138Jan 6 2011 — edited Jan 7 2011
Hello.
I'm writing a function that returns average value of every numeric column existing in a database.
I have a general idea how to do it, but I need just one more thing, look at the expamle:
select table_name from user_tables where rownum=1
this allows me to select names of all tables, and then I can access them 1 by 1...

But now i have a little problem - how to access all the atributes in selected table in this way?

Oh, and I have a problem with this rownum... For example it works for 1 (shows 1st row - name of first table) but does not for 2, or greater number :(.
And expresions like rownum < 5 work, but rownum > 3 not :/. What may be the reason?

Thank you for help!

Regards.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 4 2011
Added on Jan 6 2011
6 comments
144 views