> > I am using 
> > Oracle 8.1.5
> > DBI 1.42
and $DBD::Oracle::VERSION = '1.06';

I laucnh the script like this :
 >DBI_TRACE=2 column_info.pl

my script looks like: 

#!/bin/perl -w

use strict;
use diagnostics;
use warnings;
use DBI;


my $dbh = DBI->connect('dbi:Oracle:gpdvt', 'OSNP', 'pwd') or die "$DBI::errstr\n";
my $sth = $dbh->table_info( undef,'OSNP', '%', 'TABLE' );
#my $sth = $dbh->column_info(undef,'OSNP', 'CONTACT', 'CONTACT_ID');
while (my $row = ($sth->fetchrow_arrayref)) {
   print "$row->[1]\t$row->[2]\n";
}
$dbh->disconnect() or die "$DBI::errstr\n";
exit(0);


when i try $sth = $dbh->table_info( undef,'OSNP', '%', 'TABLE' );
everything is ok

but with $sth = $dbh->column_info(undef,'OSNP','CONTACT','CONTACT_ID')
it returns :
   -> column_info for DBD::Oracle::db (DBI::db=HASH(0x398e78)~0x17aa5c undef 'OSNP' 
'%' '%')
    <- column_info= (not implemented) at column_info.pl line 11
Can't call method "fetchrow_arrayref" on an undefined value at ./column_info.pl
        line 12 (#1)


column_info= (not implemented) ?
I don't understand :0(


Fred


On Wed, 7 Jul 2004 10:25:07 +0100
Tim Bunce <[EMAIL PROTECTED]> wrote:

> On Tue, Jul 06, 2004 at 06:11:18PM +0200, Sapet Frederic wrote:
> > On Tue, 6 Jul 2004 16:07:28 +0100
> > Tim Bunce <[EMAIL PROTECTED]> wrote:
> > 
> > > I think in some cases it's better to use
> > > 
> > >   $sth = $dbh->column_info(...)
> > > 
> > > :)
> 
> > I am using 
> > Oracle 8.1.5
> > DBI 1.42
> 
> DBD::Oracle ?
> 
> > I tried to use this method like this :
> > $sth = $dbh->column_info( undef,'OSNP', '%%' , '%%'); 
> > but $sth is never defined when I use column_info() -or primary_key_info()- as you 
> > noticed above 
> > 
> > when I do something like below, everything is OK.
> > 
> > my $type = "TABLE";
> > $sth = $dbh->table_info( undef,'OSNP', '%%', $type );
> > while (my $row = ($sth->fetchrow_arrayref)) {
> > everything is ok !
> > }
> > 
> > so everything is ok with $sth = $dbh->table_info(...)
> > but I can't find how to use $sth = $dbh->column_info(...)
> > any ideas ?
> 
> (Why '%%' and not '%'?)
> 
> Enabling trace will show you what's happening.
> 
> Tim.
> 


-- 
Fr�d�ric Sapet

***********************
G�noplante-Info
523 place des Terrasses
91000 Evry
01 60 87 37 59
[EMAIL PROTECTED]
***********************

Reply via email to