Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

DBI and using Oracle desc

by Anonymous Monk
on Jun 28, 2007 at 11:49 UTC ( #623859=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi there cellmates! I've been trying to find a DBI equivalent to the Oracle desc command and thus far failed (the only DBI DESC command that I've encountered is to do with sorting returned rows). Is there such a thing or am I going to have to get this information from an oracle session and then use Perl to work with this data?

Comment on DBI and using Oracle desc
Re: DBI and using Oracle desc
by Corion (Pope) on Jun 28, 2007 at 12:00 UTC

    As you don't tell us what the "Oracle desc command" is supposed to do, I can only guess. Maybe it does "describe" objects in the database. If so, then the Catalog Methods section of the DBI documentation will tell you what to do.

      The "desc" command simply describes a table - returning the column names, null or not null and field type. I've tried using "$sth = $dbh->table_info(",,USER\$")" (the table name is USER$) but I'm not getting anything useful from this.

        $sth = $dbh->table_info(",,USER\$")
        does not do what you might think it does.

        Maybe you wanted to use the following?

        $sth = $dbh->table_info('',undef,"USER")

        Maybe, for a first try, leave all the restrictions out and see what ->table_info gives you.

        All the information on tables, columns and databases are stored in *SUPRISE* other tables. You can write SQL queries against those system tables to get the information that you are interested without needing any special systems knowledge.

        As for the tables that you should be looking at, Try this page to get you started

Re: DBI and using Oracle desc
by adrianh (Chancellor) on Jun 28, 2007 at 12:04 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://623859]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2014-07-10 00:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (197 votes), past polls