Re: Describe <table>




I just want the info describing the table that I can see in sqlplus.

my $typz = q{ select column_name, data_type from use_tab_columns where table_name = ? };

my $sth = $dbh->prepare( $typz );

....

my $table = ... ;

my %name2type =
do
{
   eval
   {
       my $a = $sth->fetchall_arrayref( $table );

       @$a
   }
}
or die "Sorry, no data available for '$table'";

# at this point you either have a name->type map in
# %name2type or died trying (e.g., due to bogus
# column or database failure).

--
Steven Lembark                                       85-09 90th Street
Workhorse Computing                                Woodhaven, NY 11421
lembark@xxxxxxxxxxx                                     1 888 359 3508
.



Relevant Pages

  • Re: Capitalise words?
    ... > If a user wants to put a bogus name, ... > maintaining this database, requires some help from the system it's self. ... I know that Jannie Van ... if you capitalize the words then ...
    (alt.php)
  • fulltext logical files offline and cant be deleted
    ... I have a database with one data file, one log file and 2 bogus, offline ... The physical path for both FT folders is not valid. ... How do i get rid of these bogus DB "files"? ...
    (microsoft.public.sqlserver.fulltext)
  • Re: DataReader Seek
    ... I just emailed you a sample CF app (CAB and source) that loads your database with bogus item data and ...
    (microsoft.public.sqlserver.ce)
  • Strange Problem With Form
    ... mde without giving any problems. ... after I save the form and try to reopen it I get a bogus "out of ... memory error) and still won't open in either view if imported into a ... clean database. ...
    (comp.databases.ms-access)
  • Relationship tables auto-created?!?
    ... I'm designing an Access 2000 database. ... Access has automagically created some bogus tables in the relationship ... talking about automatic creation of relationship tables either. ...
    (microsoft.public.access.tablesdbdesign)