Sun751 has asked for the wisdom of the Perl Monks concerning the following question:
But I am getting following error, DBD::Informix - (warning) INFORMIXDIR not set! DBI connect('testdb','',...) failed: SQL: -25596: The INFORMIXSERVER value is no t listed in the sqlhosts file or the Registry. at C:\perlJunk\DBItestdb.pl line 11 Can't call method "prepare" on an undefined value at C:\perlJunk\DBItestdb.pl line 13. Can any one suggest me where I this error means and how can I do successful connection?Please Cheersuse DBI; my $dbh = DBI->connect("dbi:Informix:testdb"); my $sth = $dbh->prepare('select * from testdb.dbo.Flight') or die "Couldn't prepare statement: " . $dbh->errstr; $sth->execute(); while( @data = $sth->fetchrow_array()) { foreach(@data) { print "[$_]"; } print "\n\n"; } $sth->finish; $dbh->disconnect;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl DBI Informix
by Marshall (Canon) on Aug 24, 2009 at 05:32 UTC | |
by Sun751 (Beadle) on Aug 24, 2009 at 06:10 UTC | |
by Marshall (Canon) on Aug 24, 2009 at 06:48 UTC | |
by weismat (Friar) on Nov 17, 2009 at 08:30 UTC |