Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

DBI and using Oracle desc

by Anonymous Monk
on Jun 28, 2007 at 11:49 UTC ( [id://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?

Replies are listed 'Best First'.
Re: DBI and using Oracle desc
by Corion (Patriarch) 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.

        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

        $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.

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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-19 07:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found