hey all,
i'm trying to run scripts that will query different DB2 queries and return the results via perl.i'm using activestate perl 5.10.
i installed DB2 9.7 Enterprise server on a windows 2003 server, then i installed the DBI module and the DBD:DB2 module.
i'm trying to run the following code as an example:
use DBI; use strict; 1.Open a connection my $dbh = DBI->connect("dbi:DB2:omer1", "administrator", "omer2312", { +RaiseError => 1}); 1.use VALUES to retrieve value from special register my $stmt = "Values CURRENT DATE"; my $sth = $dbh->prepare($stmt); $sth->execute(); 1.associate variables with output columns... my $col1; $sth->bind_col(1,\$col1); while ($sth->fetch) { print "Today is: $col1\n"; } $sth->finish(); $dbh->disconnect();
but i get the following error:
DBI connect('omer1','administrator',...) failed: Total Environment allocation failure! Did you set up your DB2 client environment? at C:\Documents and Settings\Administrator\Desktop\DB2\Not Ready\try.pl line 4
i tried to look this up on the web but couldn't find any answers for windows, only linux.
i read something about environment variables, but i'm not sure which and to what path.
any ideas, anyone?
In reply to using DBD:DB2 with perl on DB2 for windows by omer2312
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |