Hi
I think the problem is that you are not setting the instance of the DB2 in
your perl script.
I do with a line like this:
....
$ENV{'DB2INSTANCE'}='db2inst1' ;
# Or whatever your instance name is... note the curly braces, not
parentheses!
...
#and later you do the connection with a line like this:
$dbh=DBI->connect(DBI:DB2:YourBase_name, 'username', 'password') || die
"Can�t connect: $DBI::errstr";
#or something alike...
Let me know if it works for you
I really don�t like to put usernames & passwords in a script, but I can�t
figure out any alternative.
If someone knows hoe to do it with more security, please let me know how.
Thanx
Ricardo Derbes
Altec SE
Albarrac�n 157 - San Carlos de Bariloche
+54-2944-426892
[EMAIL PROTECTED]
----- Original Message -----
From: "James Gardner" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, September 04, 2001 5:20 PM
Subject: DB2 and CGI
> My web server runs as the user apache. I can log in
> <br>and run perl dbi scripts as the user apache from the
> <br>command line to connect and select to a remote DB2
> <br>database. But when I try to connect using essentially
> <br>the same scripts in CGI running as apache I get "Total
> <br>Environment Allocation Errors."
> <br>
> <br>I can connect to informix and sybase, but am a novice
> <br>to DB2. I would be happy to send more info, except I
> <br>don't know what to send. Any help would be appreciated.
> <br>
> <br>James Gardner
> <br>
> <br>
> --
>
> _______________________________________________
> FREE Personalized E-mail at Mail.com
> http://www.mail.com/?sr=signup
>
> Talk More, Pay Less with Net2Phone Direct(R), up to 1500 minutes free!
> http://www.net2phone.com/cgi-bin/link.cgi?143
>