Skip to site navigation (Press enter)

Re: Describe

Steven Lembark Sun, 22 May 2005 19:06:01 -0700


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
[EMAIL PROTECTED]                                     1 888 359 3508
  • Previous message
  • View by thread
  • View by date
  • Next message

Reply via email to

The Mail Archive
  • The Mail Archive home
  • dbi-users - all messages
  • dbi-users - about the list
  • Expand
  • Previous message
  • Next message
  • The Mail Archive home
  • Add your mailing list
  • FAQ
  • Support
  • Privacy
  • C87D7CD527EA6449E31A0A82@[192.168.1.2]