I'm a stranger to UNIX. I've written all my PERL in the Windows environment, so please excuse my ignorance.
I'm trying to query an Informix server from a UNIX system using below code. When it first ran, it told me the server was missing from the sqlhost file. I entered it in and now I get the -908 error. When I looked it up, the 908 error indicates that it cannot connect to the box, however, I can ping it.
So I know the UNIX box can talk to the database box. Can anyone see anything that might be wrong with the code or something else I need to do that is preventing me from binding to the database?
Normally I'd research a little harder before this out, but it's kind of a rush situation.
Any help is appreciated.
Thanks!
use DBI;
my $dsn = "dbi:Informix:DIV_Table:@servername";
my $uid = ''; my $pwd = '';
$dbh = DBI->install_driver('Informix');
$dbh = DBI->connect($dsn, $user, $password,
{ RaiseError => 1, AutoCommit => 0 }) || die ("Can't connect to Informix store database: $DBI::errstr\n");
$sSQL = 'Select Count From T_Count Where Date Between #' . $firstdate . '# And #' . $lastdate . '# And Action="" . $action .. '\'';
my $sth=$dbh->prepare($sSQL) or warn("Can't prepare SQL SELECT: $DBI::errstr LINE __LINE__");
$sth->execute();
while ( @row = $sth->fetchrow_array ) {
$iVal += $row[0];
}
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the individual or entity to whom they are
addressed. If you have received this email in error destroy it
immediately.
**********************************************************************
Wal-Mart Confidential
**********************************************************************
_______________________________________________ Perl-Win32-Admin mailing list Perl-Win32-Admin@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs