473,320 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Perl DBD DB2

I'm attempting to connect to a DB2 database using perl DBD::DB2. I'm
consistently getting the following error:

[IBM][CLI Driver] SQL1042C An unexpected system error occurred.
SQLSTATE=58004

What I have done:

Installed the DB2 client, registered the database and verified
connectivity using the db2 command line utility.

Verified the database with the following command:
my @data_sources = DBI->data_sources('DB2');
print "Data sources:\n\t", join("\n\t",@data_sources),"\n\n";

Data sources:
dbi:DB2:SBLDV1

Connect code:

$dbh = DBI->connect("dbi:DB2:SBLDV1", "sbldv1", "password") or
die "Can't connect to database: $DBI::errstr\n";

Output:

DBI connect('SBLDV1','sbldv1',...) failed: [IBM][CLI Driver] SQL1042C
An unexpected system error occurred. SQLSTATE=58004
at ./db2.pl line 28
Can't connect to database: [IBM][CLI Driver] SQL1042C An unexpected
system error occurred. SQLSTATE=58004

I'm at a loss as to how to move foward. All of the posts I've seen are
solved by either installing the client or registering the database -
both of which I've done.

Sep 6 '06 #1
2 4744
What platform is the DB2 Server on and what platform are you using the
client on? If the client is on Windows, please ensure that the system
variables are correctly pointing to DB2.

Evie wrote:
I'm attempting to connect to a DB2 database using perl DBD::DB2. I'm
consistently getting the following error:

[IBM][CLI Driver] SQL1042C An unexpected system error occurred.
SQLSTATE=58004

What I have done:

Installed the DB2 client, registered the database and verified
connectivity using the db2 command line utility.

Verified the database with the following command:
my @data_sources = DBI->data_sources('DB2');
print "Data sources:\n\t", join("\n\t",@data_sources),"\n\n";

Data sources:
dbi:DB2:SBLDV1

Connect code:

$dbh = DBI->connect("dbi:DB2:SBLDV1", "sbldv1", "password") or
die "Can't connect to database: $DBI::errstr\n";

Output:

DBI connect('SBLDV1','sbldv1',...) failed: [IBM][CLI Driver] SQL1042C
An unexpected system error occurred. SQLSTATE=58004
at ./db2.pl line 28
Can't connect to database: [IBM][CLI Driver] SQL1042C An unexpected
system error occurred. SQLSTATE=58004

I'm at a loss as to how to move foward. All of the posts I've seen are
solved by either installing the client or registering the database -
both of which I've done.
Sep 6 '06 #2
Fixed it!

I had installed the regular client NOT the developer version of the
client. Perusing the log files helped with the diagnosis. I was
missing the required library files.
kf******@us.ibm.com wrote:
What platform is the DB2 Server on and what platform are you using the
client on? If the client is on Windows, please ensure that the system
variables are correctly pointing to DB2.

Evie wrote:
I'm attempting to connect to a DB2 database using perl DBD::DB2. I'm
consistently getting the following error:

[IBM][CLI Driver] SQL1042C An unexpected system error occurred.
SQLSTATE=58004

What I have done:

Installed the DB2 client, registered the database and verified
connectivity using the db2 command line utility.

Verified the database with the following command:
my @data_sources = DBI->data_sources('DB2');
print "Data sources:\n\t", join("\n\t",@data_sources),"\n\n";

Data sources:
dbi:DB2:SBLDV1

Connect code:

$dbh = DBI->connect("dbi:DB2:SBLDV1", "sbldv1", "password") or
die "Can't connect to database: $DBI::errstr\n";

Output:

DBI connect('SBLDV1','sbldv1',...) failed: [IBM][CLI Driver] SQL1042C
An unexpected system error occurred. SQLSTATE=58004
at ./db2.pl line 28
Can't connect to database: [IBM][CLI Driver] SQL1042C An unexpected
system error occurred. SQLSTATE=58004

I'm at a loss as to how to move foward. All of the posts I've seen are
solved by either installing the client or registering the database -
both of which I've done.
Sep 14 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mark Wilson CPU | last post by:
This must be easy, but I'm missing something... I want to execute a Perl script, and capture ALL its output into a PHP variable. Here are my 2 files: -------------------------------------...
31
by: surfunbear | last post by:
I've read some posts on Perl versus Python and studied a bit of my Python book. I'm a software engineer, familiar with C++ objected oriented development, but have been using Perl because it is...
0
by: Kirt Loki Dankmyer | last post by:
So, I download the latest "stable" tar for perl (5.8.7) and try to compile it on the Solaris 8 (SPARC) box that I administrate. I try all sorts of different switches, but I can't get it to compile....
13
by: Otto J. Makela | last post by:
I'm trying to install to php the Perl-1.0.0.tgz package (from http://pecl.php.net/package/perl, enabling one to call perl libraries) to a pre-existing Solaris system. Unfortunately, the attempt...
6
by: surfivor | last post by:
I may be involved in a data migration project involving databases and creating XML feeds. Our site is PHP based, so I imagine the team might suggest PHP, but I had a look at the PHP documentation...
4
by: billb | last post by:
I installed a perl extension for PHP to use some perl inside my php primarily because I have perl working with oracle and not php and oracle. So I want to use my old perl scripts, and use the...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.