DBD::DB2 question need an example
DBD::DB2 question need an example
am 10.01.2007 22:07:29 von brent.brimacomb
------_=_NextPart_001_01C734FB.56B8889A
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Well I'm new to both Perl and DBD::DB2, so please bare with me.
=20
I've installed the latest Active state Perl, the latest DBI and DBD::DB2
from CPAN. =20
=20
I'm trying to develop a program that runs on a Windows server that does
a SELECT from a DB2 that's on an Os/390 box running several DB2's.
What I'm looking for is a good example of a program that does that.
Here's what I have, but I can't make the connection work......
=20
use warnings;
use strict;
use diagnostics;
=20
use DBI;
use DBD::DB2;
use DBD::DB2::CONSTANTS;
=20
print "Operating System =3D $^O\n";
print "Perl Binary =3D $^X\n";
print "Perl Version =3D $]\n";
print "DBI Version =3D $DBI::VERSION\n";
print "DBD::DB2 Version =3D $DBD::DB2::VERSION\n\n";
=20
my @DB2DataSources =3D DBI->data_sources("DB2");
=20
print "Available DB2 DSNs:\n\n";
foreach my $dsn ( @DB2DataSources )
{
print " $dsn \n";
}
=20
my $hostname =3D "dsn2.prdpl.abc123.com"; # This is the hostname of =
the
server you are wanting to connect to.
my $port =3D "5002"; # dsn port number.
my $protocol =3D "TCPIP"; # communication protocol
my $database =3D "DSN2"; # This is the database name
that you are connecting to on the above host.
my $user =3D "G156505"; # User that is =
connecting
to the database
my $password =3D "xxxxxx12"; # Password the User is
connecting to the database
=20
# my $dsnx =3D "dbi:DB2:database=3D$database; HOSTNAME=3D$hostname;
PORT=3D$port; PROTOCOL=3D$protocol; UID=3D$user; PWD=3D$password;";
# my $dsnx =3D "dbi:DB2:database=3DUSNETAALDSN2";
my $dsnx =3D "dbi:DB2:database=3D$database; HOSTNAME=3D$hostname; =
PORT=3D$port;
PROTOCOL=3D$protocol; UID=3D$user; PWD=3D$password;";
=20
my $dbh =3D DBI->connect($dsnx,=20
$user,=20
$password) || die "Connection failed with error:
$DBI::errstr";
=20
my $sql =3D qq( SELECT CUS_NBR, CUS_LST_NM FROM TEST.XXXR0471_CUSTAB =
WHERE
CUS_NBR =3D 535077); =20
print $sql; =20
my $sth =3D $dbh->prepare( $sql );
$sth->execute(); # Execute the select statement
my ( $cusno, $lastname );
$sth->bind_columns( undef, \$cusno, \$lastname );
=20
while( $sth->fetch() ) {
print "$empno, $lastname\n";
}
=20
$sth->finish(); # Tell the database handle you are finished with it.
$sth->disconnect(); # Disconnect from the database.=20
=20
Brent Brimacomb CISSP, CISM=20
EDS - Information Security=20
MS 354=20
4000 North Mingo Rd.=20
Tulsa, OK 74116=20
* phone: +01-918-939-6534=20
* mailto:brent.brimacomb@eds.com=20
=20
------_=_NextPart_001_01C734FB.56B8889A--
Re: DBD::DB2 question need an example
am 10.01.2007 22:20:46 von jseger
What error are you seeing?
On 1/10/07, Brimacomb, Brent wrote:
> Well I'm new to both Perl and DBD::DB2, so please bare with me.
>
> I've installed the latest Active state Perl, the latest DBI and DBD::DB2
> from CPAN.
>
> I'm trying to develop a program that runs on a Windows server that does
> a SELECT from a DB2 that's on an Os/390 box running several DB2's.
> What I'm looking for is a good example of a program that does that.
> Here's what I have, but I can't make the connection work......
>
> use warnings;
> use strict;
> use diagnostics;
>
> use DBI;
> use DBD::DB2;
> use DBD::DB2::CONSTANTS;
>
> print "Operating System = $^O\n";
> print "Perl Binary = $^X\n";
> print "Perl Version = $]\n";
> print "DBI Version = $DBI::VERSION\n";
> print "DBD::DB2 Version = $DBD::DB2::VERSION\n\n";
>
> my @DB2DataSources = DBI->data_sources("DB2");
>
> print "Available DB2 DSNs:\n\n";
> foreach my $dsn ( @DB2DataSources )
> {
> print " $dsn \n";
> }
>
> my $hostname = "dsn2.prdpl.abc123.com"; # This is the hostname of the
> server you are wanting to connect to.
> my $port = "5002"; # dsn port number.
> my $protocol = "TCPIP"; # communication protocol
> my $database = "DSN2"; # This is the database name
> that you are connecting to on the above host.
> my $user = "G156505"; # User that is connecting
> to the database
> my $password = "xxxxxx12"; # Password the User is
> connecting to the database
>
> # my $dsnx = "dbi:DB2:database=$database; HOSTNAME=$hostname;
> PORT=$port; PROTOCOL=$protocol; UID=$user; PWD=$password;";
> # my $dsnx = "dbi:DB2:database=USNETAALDSN2";
> my $dsnx = "dbi:DB2:database=$database; HOSTNAME=$hostname; PORT=$port;
> PROTOCOL=$protocol; UID=$user; PWD=$password;";
>
>
> my $dbh = DBI->connect($dsnx,
> $user,
> $password) || die "Connection failed with error:
> $DBI::errstr";
>
> my $sql = qq( SELECT CUS_NBR, CUS_LST_NM FROM TEST.XXXR0471_CUSTAB WHERE
> CUS_NBR = 535077);
> print $sql;
> my $sth = $dbh->prepare( $sql );
> $sth->execute(); # Execute the select statement
> my ( $cusno, $lastname );
> $sth->bind_columns( undef, \$cusno, \$lastname );
>
> while( $sth->fetch() ) {
> print "$empno, $lastname\n";
> }
>
> $sth->finish(); # Tell the database handle you are finished with it.
> $sth->disconnect(); # Disconnect from the database.
>
>
> Brent Brimacomb CISSP, CISM
> EDS - Information Security
> MS 354
> 4000 North Mingo Rd.
> Tulsa, OK 74116
> * phone: +01-918-939-6534
> * mailto:brent.brimacomb@eds.com
>
>
>
>
--
------------------------------------------------------------ --------------------------------------------------
The darkest places in hell are reserved for those who maintain their
neutrality in times of moral crisis.
Dante Alighieri (1265 - 1321)
They who would give up an essential liberty for temporary security,
deserve neither liberty or security.
Benjamin Franklin
Our lives begin to end the day we become silent about things that matter.
Martin Luther King
The right of the people to be secure in their persons, houses, papers,
and effects, against unreasonable searches and seizures, shall not be
violated, and no warrants shall issue, but upon probable cause,
supported by oath or affirmation, and particularly describing the
place to be searched, and the persons or things to be seized.
Amendment IV to the Constitution of the United States
------------------------------------------------------------ --------------------------------------------------
RE: DBD::DB2 question need an example
am 10.01.2007 22:25:29 von brent.brimacomb
: [IBM][CLI Driver] CLI0124E Invalid argument value. SQLSTATE=3DHY009 =
at
AACTSS.pl line 38
Uncaught exception from user code:
Connection failed with error: [IBM][CLI Driver] CLI0124E
Invalid argument value. SQLSTATE=3DHY009 at AACTSS.pl line 38.
at AACTSS.pl line 38=20
Brent
-----Original Message-----
From: Jeffrey Seger [mailto:jseger@gmail.com]=20
Sent: Wednesday, January 10, 2007 3:21 PM
To: Brimacomb, Brent
Cc: dbi-users@perl.org
Subject: Re: DBD::DB2 question need an example
What error are you seeing?
On 1/10/07, Brimacomb, Brent wrote:
> Well I'm new to both Perl and DBD::DB2, so please bare with me.
>
> I've installed the latest Active state Perl, the latest DBI and=20
> DBD::DB2 from CPAN.
>
> I'm trying to develop a program that runs on a Windows server that=20
> does a SELECT from a DB2 that's on an Os/390 box running several
DB2's.
> What I'm looking for is a good example of a program that does that.
> Here's what I have, but I can't make the connection work......
>
> use warnings;
> use strict;
> use diagnostics;
>
> use DBI;
> use DBD::DB2;
> use DBD::DB2::CONSTANTS;
>
> print "Operating System =3D $^O\n";
> print "Perl Binary =3D $^X\n";
> print "Perl Version =3D $]\n";
> print "DBI Version =3D $DBI::VERSION\n";
> print "DBD::DB2 Version =3D $DBD::DB2::VERSION\n\n";
>
> my @DB2DataSources =3D DBI->data_sources("DB2");
>
> print "Available DB2 DSNs:\n\n";
> foreach my $dsn ( @DB2DataSources )
> {
> print " $dsn \n";
> }
>
> my $hostname =3D "dsn2.prdpl.abc123.com"; # This is the hostname of=20
> the server you are wanting to connect to.
> my $port =3D "5002"; # dsn port number.
> my $protocol =3D "TCPIP"; # communication =
protocol
> my $database =3D "DSN2"; # This is the database =
name
> that you are connecting to on the above host.
> my $user =3D "G156505"; # User that is
connecting
> to the database
> my $password =3D "xxxxxx12"; # Password the User is
> connecting to the database
>
> # my $dsnx =3D "dbi:DB2:database=3D$database; HOSTNAME=3D$hostname;=20
> PORT=3D$port; PROTOCOL=3D$protocol; UID=3D$user; PWD=3D$password;"; # =
my=20
> $dsnx =3D "dbi:DB2:database=3DUSNETAALDSN2"; my $dsnx =
> "dbi:DB2:database=3D$database; HOSTNAME=3D$hostname; PORT=3D$port;=20
> PROTOCOL=3D$protocol; UID=3D$user; PWD=3D$password;";
>
>
> my $dbh =3D DBI->connect($dsnx,
> $user,
> $password) || die "Connection failed with error:
> $DBI::errstr";
>
> my $sql =3D qq( SELECT CUS_NBR, CUS_LST_NM FROM TEST.XXXR0471_CUSTAB=20
> WHERE CUS_NBR =3D 535077); print $sql; my $sth =3D $dbh->prepare( $sql =
);=20
> $sth->execute(); # Execute the select statement my ( $cusno,=20
> $lastname ); $sth->bind_columns( undef, \$cusno, \$lastname );
>
> while( $sth->fetch() ) {
> print "$empno, $lastname\n";
> }
>
> $sth->finish(); # Tell the database handle you are finished with
it.
> $sth->disconnect(); # Disconnect from the database.
>
>
> Brent Brimacomb CISSP, CISM
> EDS - Information Security
> MS 354
> 4000 North Mingo Rd.
> Tulsa, OK 74116
> * phone: +01-918-939-6534
> * mailto:brent.brimacomb@eds.com
>
>
>
>
--
------------------------------------------------------------ ------------
--------------------------------------
The darkest places in hell are reserved for those who maintain their
neutrality in times of moral crisis.
Dante Alighieri (1265 - 1321)
They who would give up an essential liberty for temporary security,
deserve neither liberty or security.
Benjamin Franklin
Our lives begin to end the day we become silent about things that
matter.
Martin Luther King
The right of the people to be secure in their persons, houses, papers,
and effects, against unreasonable searches and seizures, shall not be
violated, and no warrants shall issue, but upon probable cause,
supported by oath or affirmation, and particularly describing the place
to be searched, and the persons or things to be seized.
Amendment IV to the Constitution of the United States
------------------------------------------------------------ ------------
--------------------------------------
Re: DBD::DB2 question need an example
am 11.01.2007 02:22:06 von jseger
On 1/10/07, Brimacomb, Brent wrote:
> : [IBM][CLI Driver] CLI0124E Invalid argument value. SQLSTATE=HY009 at
> AACTSS.pl line 38
> Uncaught exception from user code:
> Connection failed with error: [IBM][CLI Driver] CLI0124E
> Invalid argument value. SQLSTATE=HY009 at AACTSS.pl line 38.
> at AACTSS.pl line 38
>
> Brent
I'm no DB2 expert, but a quick google revealed that that error message
means that DB2 is not liking something about your $dsn. The first
thing I don't know is whether that database showed up in your list of
DB2 datasources. If it is showing up, try just passing the DataSource
Name in the $dsn portion of the connect string:
my $dsn = 'USNETAALDSN2';
my $dbh = DBI->connect("dbi:DB2:$dsn",$user,$pass) or die $DBI::errstr;
According to perldoc DBD::DB2, your format is correct for an
un-cataloged database. I'm wondering if the database name on the
OS/390 box is different from the alias that you have cataloged on your
local box, since this format uses the database name on the host, not
the DSN name that as it's cataloged on the client.
--
------------------------------------------------------------ --------------------------------------------------
The darkest places in hell are reserved for those who maintain their
neutrality in times of moral crisis.
Dante Alighieri (1265 - 1321)
They who would give up an essential liberty for temporary security,
deserve neither liberty or security.
Benjamin Franklin
Our lives begin to end the day we become silent about things that matter.
Martin Luther King
The right of the people to be secure in their persons, houses, papers,
and effects, against unreasonable searches and seizures, shall not be
violated, and no warrants shall issue, but upon probable cause,
supported by oath or affirmation, and particularly describing the
place to be searched, and the persons or things to be seized.
Amendment IV to the Constitution of the United States
------------------------------------------------------------ --------------------------------------------------
RE: DBD::DB2 question need an example
am 11.01.2007 16:19:01 von brent.brimacomb
First let me say THANK YOU! for trying to help. I've been beating my
head on this one for a couple days now.... =20
I tried what you suggested and basically got the same error:
DBI connect('database=3DUSNETAALDSN2','Z156505',...) failed: [IBM][CLI
Driver] CLI
0124E Invalid argument value. SQLSTATE=3DHY009 at aactss.pl line 38
Uncaught exception from user code:
Connection failed with error: [IBM][CLI Driver] CLI0124E
Invalid argume
nt value. SQLSTATE=3DHY009 at aactss.pl line 38.
at aactss.pl line 38
Brent=20
-----Original Message-----
From: Jeffrey Seger [mailto:jseger@gmail.com]=20
Sent: Wednesday, January 10, 2007 7:22 PM
To: Brimacomb, Brent
Cc: dbi-users@perl.org
Subject: Re: DBD::DB2 question need an example
On 1/10/07, Brimacomb, Brent wrote:
> : [IBM][CLI Driver] CLI0124E Invalid argument value. SQLSTATE=3DHY009 =
> at AACTSS.pl line 38 Uncaught exception from user code:
> Connection failed with error: [IBM][CLI Driver] CLI0124E=20
> Invalid argument value. SQLSTATE=3DHY009 at AACTSS.pl line 38.
> at AACTSS.pl line 38
>
> Brent
I'm no DB2 expert, but a quick google revealed that that error message
means that DB2 is not liking something about your $dsn. The first thing
I don't know is whether that database showed up in your list of
DB2 datasources. If it is showing up, try just passing the DataSource
Name in the $dsn portion of the connect string:
my $dsn =3D 'USNETAALDSN2';
my $dbh =3D DBI->connect("dbi:DB2:$dsn",$user,$pass) or die =
$DBI::errstr;
According to perldoc DBD::DB2, your format is correct for an
un-cataloged database. I'm wondering if the database name on the OS/390
box is different from the alias that you have cataloged on your local
box, since this format uses the database name on the host, not the DSN
name that as it's cataloged on the client.
--
------------------------------------------------------------ ------------
--------------------------------------
The darkest places in hell are reserved for those who maintain their
neutrality in times of moral crisis.
Dante Alighieri (1265 - 1321)
They who would give up an essential liberty for temporary security,
deserve neither liberty or security.
Benjamin Franklin
Our lives begin to end the day we become silent about things that
matter.
Martin Luther King
The right of the people to be secure in their persons, houses, papers,
and effects, against unreasonable searches and seizures, shall not be
violated, and no warrants shall issue, but upon probable cause,
supported by oath or affirmation, and particularly describing the place
to be searched, and the persons or things to be seized.
Amendment IV to the Constitution of the United States
------------------------------------------------------------ ------------
--------------------------------------
RE: DBD::DB2 question need an example
am 15.01.2007 18:04:50 von db2perl
--=_alternative 005DD28E86257264_=
Content-Type: text/plain; charset="US-ASCII"
Hi Jeffrey,
Can you please paste the output from the entire script you provided in the
original email (the one that displays the versions of everything)? Also,
can you run the following commands from the DB2 CLP and give us the
output:
list node directory
list database directory
get dbm cfg
Thanks,
"Brimacomb, Brent"
01/11/2007 09:19 AM
To
"Jeffrey Seger"
cc
Subject
RE: DBD::DB2 question need an example
First let me say THANK YOU! for trying to help. I've been beating my
head on this one for a couple days now....
I tried what you suggested and basically got the same error:
DBI connect('database=USNETAALDSN2','Z156505',...) failed: [IBM][CLI
Driver] CLI
0124E Invalid argument value. SQLSTATE=HY009 at aactss.pl line 38
Uncaught exception from user code:
Connection failed with error: [IBM][CLI Driver] CLI0124E
Invalid argume
nt value. SQLSTATE=HY009 at aactss.pl line 38.
at aactss.pl line 38
Brent
-----Original Message-----
From: Jeffrey Seger [mailto:jseger@gmail.com]
Sent: Wednesday, January 10, 2007 7:22 PM
To: Brimacomb, Brent
Cc: dbi-users@perl.org
Subject: Re: DBD::DB2 question need an example
On 1/10/07, Brimacomb, Brent wrote:
> : [IBM][CLI Driver] CLI0124E Invalid argument value. SQLSTATE=HY009
> at AACTSS.pl line 38 Uncaught exception from user code:
> Connection failed with error: [IBM][CLI Driver] CLI0124E
> Invalid argument value. SQLSTATE=HY009 at AACTSS.pl line 38.
> at AACTSS.pl line 38
>
> Brent
I'm no DB2 expert, but a quick google revealed that that error message
means that DB2 is not liking something about your $dsn. The first thing
I don't know is whether that database showed up in your list of
DB2 datasources. If it is showing up, try just passing the DataSource
Name in the $dsn portion of the connect string:
my $dsn = 'USNETAALDSN2';
my $dbh = DBI->connect("dbi:DB2:$dsn",$user,$pass) or die $DBI::errstr;
According to perldoc DBD::DB2, your format is correct for an
un-cataloged database. I'm wondering if the database name on the OS/390
box is different from the alias that you have cataloged on your local
box, since this format uses the database name on the host, not the DSN
name that as it's cataloged on the client.
--
------------------------------------------------------------ ------------
--------------------------------------
The darkest places in hell are reserved for those who maintain their
neutrality in times of moral crisis.
Dante Alighieri (1265 - 1321)
They who would give up an essential liberty for temporary security,
deserve neither liberty or security.
Benjamin Franklin
Our lives begin to end the day we become silent about things that
matter.
Martin Luther King
The right of the people to be secure in their persons, houses, papers,
and effects, against unreasonable searches and seizures, shall not be
violated, and no warrants shall issue, but upon probable cause,
supported by oath or affirmation, and particularly describing the place
to be searched, and the persons or things to be seized.
Amendment IV to the Constitution of the United States
------------------------------------------------------------ ------------
--------------------------------------
--=_alternative 005DD28E86257264_=--
RE: DBD::DB2 question need an example
am 15.01.2007 18:38:01 von brent.brimacomb
------_=_NextPart_001_01C738CB.E7913D47
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Being new to Perl I'm not sure how to list out the variables you asked
for?
list node directory=20
list database directory=20
get dbm cfg=20
=20
Below is the complete output of the current program.
=20
Thank you!
Brent
=20
=20
=20
=20
=20
C:\Perl>perl aactss.pl
Subroutine AUTOLOAD redefined at c:/Perl/site/lib/DBD/DB2/CONSTANTS.pm
line
1560 (#1)
(W redefine) You redefined a subroutine. To suppress this warning,
say
=20
{
no warnings 'redefine';
eval "sub name { ... }";
}
=20
Operating System =3D MSWin32
Perl Binary =3D c:\Perl\bin\perl.exe
Perl Version =3D 5.008008
DBI Version =3D 1.53
DBD::DB2 Version =3D 0.78
=20
Available DB2 DSNs:
=20
DBI connect('dsn2.prdplexa.sabre.com','Z156505',...) failed: [IBM][CLI
Driver] C
LI0124E Invalid argument value. SQLSTATE=3DHY009 at aactss.pl line 66
Uncaught exception from user code:
Connection failed with error: [IBM][CLI Driver] CLI0124E
Invalid argume
nt value. SQLSTATE=3DHY009 at aactss.pl line 66.
at aactss.pl line 66
=20
C:\Perl>
=20
=20
________________________________
From: Kellen F Bombardier [mailto:kfbombar@us.ibm.com] On Behalf
Of db2perl
Sent: Monday, January 15, 2007 11:05 AM
To: Brimacomb, Brent
Cc: dbi-users@perl.org; Jeffrey Seger
Subject: RE: DBD::DB2 question need an example
=09
=09
Hi Jeffrey,=20
=09
Can you please paste the output from the entire script you
provided in the original email (the one that displays the versions of
everything)? Also, can you run the following commands from the DB2 CLP
and give us the output:=20
=09
list node directory=20
list database directory=20
get dbm cfg=20
=09
Thanks,=20
=09
=09
=09
=09
"Brimacomb, Brent" =20
01/11/2007 09:19 AM=20
To
"Jeffrey Seger" =20
cc
=20
Subject
RE: DBD::DB2 question need an example
=09
First let me say THANK YOU! for trying to help. I've been
beating my
head on this one for a couple days now.... =20
=09
I tried what you suggested and basically got the same error:
=09
DBI connect('database=3DUSNETAALDSN2','Z156505',...) failed:
[IBM][CLI
Driver] CLI
0124E Invalid argument value. SQLSTATE=3DHY009 at aactss.pl line
38
Uncaught exception from user code:
Connection failed with error: [IBM][CLI Driver] CLI0124E
Invalid argume
nt value. SQLSTATE=3DHY009 at aactss.pl line 38.
at aactss.pl line 38
=09
=09
Brent=20
=09
-----Original Message-----
From: Jeffrey Seger [mailto:jseger@gmail.com]=20
Sent: Wednesday, January 10, 2007 7:22 PM
To: Brimacomb, Brent
Cc: dbi-users@perl.org
Subject: Re: DBD::DB2 question need an example
=09
On 1/10/07, Brimacomb, Brent wrote:
> : [IBM][CLI Driver] CLI0124E Invalid argument value.
SQLSTATE=3DHY009=20
> at AACTSS.pl line 38 Uncaught exception from user code:
> Connection failed with error: [IBM][CLI Driver]
CLI0124E=20
> Invalid argument value. SQLSTATE=3DHY009 at AACTSS.pl line 38.
> at AACTSS.pl line 38
>
> Brent
=09
I'm no DB2 expert, but a quick google revealed that that error
message
means that DB2 is not liking something about your $dsn. The
first thing
I don't know is whether that database showed up in your list of
DB2 datasources. If it is showing up, try just passing the
DataSource
Name in the $dsn portion of the connect string:
=09
my $dsn =3D 'USNETAALDSN2';
my $dbh =3D DBI->connect("dbi:DB2:$dsn",$user,$pass) or die
$DBI::errstr;
=09
According to perldoc DBD::DB2, your format is correct for an
un-cataloged database. I'm wondering if the database name on
the OS/390
box is different from the alias that you have cataloged on your
local
box, since this format uses the database name on the host, not
the DSN
name that as it's cataloged on the client.
=09
--
=09
------------------------------------------------------------ ------------
--------------------------------------
The darkest places in hell are reserved for those who maintain
their
neutrality in times of moral crisis.
Dante Alighieri (1265 - 1321)
=09
They who would give up an essential liberty for temporary
security,
deserve neither liberty or security.
Benjamin Franklin
=09
Our lives begin to end the day we become silent about things
that
matter.
Martin Luther King
=09
The right of the people to be secure in their persons, houses,
papers,
and effects, against unreasonable searches and seizures, shall
not be
violated, and no warrants shall issue, but upon probable cause,
supported by oath or affirmation, and particularly describing
the place
to be searched, and the persons or things to be seized.
=09
Amendment IV to the Constitution of the United States
=09
------------------------------------------------------------ ------------
--------------------------------------
=09
=09
------_=_NextPart_001_01C738CB.E7913D47--
RE: DBD::DB2 question need an example
am 15.01.2007 20:23:01 von db2perl
--=_alternative 006A794686257264_=
Content-Type: text/plain; charset="US-ASCII"
Hi Brent,
The problem appears to be that you are using 0.78 version of DBD::DB2. You
will need to update to the latest version for this to work correctly.
"Brimacomb, Brent"
01/15/2007 11:38 AM
To
db2perl/Toronto/IBM@IBMCA
cc
, "Jeffrey Seger"
Subject
RE: DBD::DB2 question need an example
Being new to Perl I'm not sure how to list out the variables you asked
for?
list node directory
list database directory
get dbm cfg
Below is the complete output of the current program.
Thank you!
Brent
C:\Perl>perl aactss.pl
Subroutine AUTOLOAD redefined at c:/Perl/site/lib/DBD/DB2/CONSTANTS.pm
line
1560 (#1)
(W redefine) You redefined a subroutine. To suppress this warning,
say
{
no warnings 'redefine';
eval "sub name { ... }";
}
Operating System = MSWin32
Perl Binary = c:\Perl\bin\perl.exe
Perl Version = 5.008008
DBI Version = 1.53
DBD::DB2 Version = 0.78
Available DB2 DSNs:
DBI connect('dsn2.prdplexa.sabre.com','Z156505',...) failed: [IBM][CLI
Driver] C
LI0124E Invalid argument value. SQLSTATE=HY009 at aactss.pl line 66
Uncaught exception from user code:
Connection failed with error: [IBM][CLI Driver] CLI0124E
Invalid argume
nt value. SQLSTATE=HY009 at aactss.pl line 66.
at aactss.pl line 66
C:\Perl>
________________________________
From: Kellen F Bombardier [mailto:kfbombar@us.ibm.com] On
Behalf
Of db2perl
Sent: Monday, January 15, 2007 11:05 AM
To: Brimacomb, Brent
Cc: dbi-users@perl.org; Jeffrey Seger
Subject: RE: DBD::DB2 question need an example
Hi Jeffrey,
Can you please paste the output from the entire script
you
provided in the original email (the one that displays the versions of
everything)? Also, can you run the following commands from the DB2 CLP
and give us the output:
list node directory
list database directory
get dbm cfg
Thanks,
"Brimacomb, Brent"
01/11/2007 09:19 AM
To
"Jeffrey Seger"
cc
Subject
RE: DBD::DB2 question need an example
First let me say THANK YOU! for trying to help. I've
been
beating my
head on this one for a couple days now....
I tried what you suggested and basically got the same
error:
DBI connect('database=USNETAALDSN2','Z156505',...)
failed:
[IBM][CLI
Driver] CLI
0124E Invalid argument value. SQLSTATE=HY009 at
aactss.pl line
38
Uncaught exception from user code:
Connection failed with error: [IBM][CLI Driver]
CLI0124E
Invalid argume
nt value. SQLSTATE=HY009 at aactss.pl line 38.
at aactss.pl line 38
Brent
-----Original Message-----
From: Jeffrey Seger [mailto:jseger@gmail.com]
Sent: Wednesday, January 10, 2007 7:22 PM
To: Brimacomb, Brent
Cc: dbi-users@perl.org
Subject: Re: DBD::DB2 question need an example
On 1/10/07, Brimacomb, Brent
wrote:
> : [IBM][CLI Driver] CLI0124E Invalid argument value.
SQLSTATE=HY009
> at AACTSS.pl line 38 Uncaught exception from user code:
> Connection failed with error: [IBM][CLI Driver]
CLI0124E
> Invalid argument value. SQLSTATE=HY009 at AACTSS.pl
line 38.
> at AACTSS.pl line 38
>
> Brent
I'm no DB2 expert, but a quick google revealed that that
error
message
means that DB2 is not liking something about your $dsn.
The
first thing
I don't know is whether that database showed up in your
list of
DB2 datasources. If it is showing up, try just passing
the
DataSource
Name in the $dsn portion of the connect string:
my $dsn = 'USNETAALDSN2';
my $dbh = DBI->connect("dbi:DB2:$dsn",$user,$pass) or die
$DBI::errstr;
According to perldoc DBD::DB2, your format is correct for
an
un-cataloged database. I'm wondering if the database
name on
the OS/390
box is different from the alias that you have cataloged
on your
local
box, since this format uses the database name on the
host, not
the DSN
name that as it's cataloged on the client.
--
------------------------------------------------------------ ------------
--------------------------------------
The darkest places in hell are reserved for those who
maintain
their
neutrality in times of moral crisis.
Dante Alighieri (1265 - 1321)
They who would give up an essential liberty for temporary
security,
deserve neither liberty or security.
Benjamin Franklin
Our lives begin to end the day we become silent about
things
that
matter.
Martin Luther King
The right of the people to be secure in their persons,
houses,
papers,
and effects, against unreasonable searches and seizures,
shall
not be
violated, and no warrants shall issue, but upon probable
cause,
supported by oath or affirmation, and particularly
describing
the place
to be searched, and the persons or things to be seized.
Amendment IV to the Constitution of the United States
------------------------------------------------------------ ------------
--------------------------------------
--=_alternative 006A794686257264_=--
RE: DBD::DB2 question need an example
am 17.01.2007 13:39:39 von brent.brimacomb
I was finally able to get the version 1.0 of the DBD::DB2 installed, but
am still getting the same error as before? Any more ideas, I'll try
anything.....
Brent
C:\Perl>perl aactss.pl
Subroutine AUTOLOAD redefined at c:/Perl/site/lib/DBD/DB2/CONSTANTS.pm
line
1563 (#1)
(W redefine) You redefined a subroutine. To suppress this warning,
say
{
no warnings 'redefine';
eval "sub name { ... }";
}
Operating System =3D MSWin32
Perl Binary =3D c:\Perl\bin\perl.exe
Perl Version =3D 5.008008
DBI Version =3D 1.53
DBD::DB2 Version =3D 1.0
Available DB2 DSNs:
DBI connect('dsn2.prdplexa.sabre.com','Z156505',...) failed: [IBM][CLI
Driver] C
LI0124E Invalid argument value. SQLSTATE=3DHY009 at aactss.pl line 67
Uncaught exception from user code:
Connection failed with error: [IBM][CLI Driver] CLI0124E
Invalid argume
nt value. SQLSTATE=3DHY009 at aactss.pl line 67.
at aactss.pl line 67
C:\Perl>
=20
-----Original Message-----
From: Kellen F Bombardier [mailto:kfbombar@us.ibm.com] On Behalf Of
db2perl
Sent: Monday, January 15, 2007 1:23 PM
To: Brimacomb, Brent
Cc: db2perl; dbi-users@perl.org; Jeffrey Seger
Subject: RE: DBD::DB2 question need an example
Hi Brent,
The problem appears to be that you are using 0.78 version of DBD::DB2.
You will need to update to the latest version for this to work
correctly.
"Brimacomb, Brent" =20
01/15/2007 11:38 AM
To
db2perl/Toronto/IBM@IBMCA
cc
, "Jeffrey Seger"
Subject
RE: DBD::DB2 question need an example
Being new to Perl I'm not sure how to list out the variables you asked
for?
list node directory=20
list database directory=20
get dbm cfg=20
=20
Below is the complete output of the current program.
=20
Thank you!
Brent
=20
=20
=20
=20
=20
C:\Perl>perl aactss.pl
Subroutine AUTOLOAD redefined at c:/Perl/site/lib/DBD/DB2/CONSTANTS.pm
line
1560 (#1)
(W redefine) You redefined a subroutine. To suppress this warning,
say
=20
{
no warnings 'redefine';
eval "sub name { ... }";
}
=20
Operating System =3D MSWin32
Perl Binary =3D c:\Perl\bin\perl.exe
Perl Version =3D 5.008008
DBI Version =3D 1.53
DBD::DB2 Version =3D 0.78
=20
Available DB2 DSNs:
=20
DBI connect('dsn2.prdplexa.sabre.com','Z156505',...) failed: [IBM][CLI
Driver] C
LI0124E Invalid argument value. SQLSTATE=3DHY009 at aactss.pl line 66
Uncaught exception from user code:
Connection failed with error: [IBM][CLI Driver] CLI0124E
Invalid argume
nt value. SQLSTATE=3DHY009 at aactss.pl line 66.
at aactss.pl line 66
=20
C:\Perl>
=20
=20
________________________________
From: Kellen F Bombardier [mailto:kfbombar@us.ibm.com]
On=20
Behalf
Of db2perl
Sent: Monday, January 15, 2007 11:05 AM
To: Brimacomb, Brent
Cc: dbi-users@perl.org; Jeffrey Seger
Subject: RE: DBD::DB2 question need an example
=20
=20
Hi Jeffrey,=20
=20
Can you please paste the output from the entire script=20
you
provided in the original email (the one that displays the versions of
everything)? Also, can you run the following commands from the DB2 CLP
and give us the output:=20
=20
list node directory=20
list database directory=20
get dbm cfg=20
=20
Thanks,=20
=20
=20
=20
=20
"Brimacomb, Brent" =20
01/11/2007 09:19 AM=20
To
"Jeffrey Seger" =20
cc
=20
Subject
RE: DBD::DB2 question need an example
=20
First let me say THANK YOU! for trying to help. I've=20
been
beating my
head on this one for a couple days now....=20
=20
I tried what you suggested and basically got the same=20
error:
=20
DBI connect('database=3DUSNETAALDSN2','Z156505',...)=20
failed:
[IBM][CLI
Driver] CLI
0124E Invalid argument value. SQLSTATE=3DHY009 at=20
aactss.pl line
38
Uncaught exception from user code:
Connection failed with error: [IBM][CLI Driver]=20
CLI0124E
Invalid argume
nt value. SQLSTATE=3DHY009 at aactss.pl line 38.
at aactss.pl line 38
=20
=20
Brent=20
=20
-----Original Message-----
From: Jeffrey Seger [mailto:jseger@gmail.com]=20
Sent: Wednesday, January 10, 2007 7:22 PM
To: Brimacomb, Brent
Cc: dbi-users@perl.org
Subject: Re: DBD::DB2 question need an example
=20
On 1/10/07, Brimacomb, Brent =20
wrote:
> : [IBM][CLI Driver] CLI0124E Invalid argument value.
SQLSTATE=3DHY009=20
> at AACTSS.pl line 38 Uncaught exception from user
code:
> Connection failed with error: [IBM][CLI
Driver]
CLI0124E=20
> Invalid argument value. SQLSTATE=3DHY009 at AACTSS.pl =
line 38.
> at AACTSS.pl line 38
>
> Brent
=20
I'm no DB2 expert, but a quick google revealed that
that=20
error
message
means that DB2 is not liking something about your $dsn.
The
first thing
I don't know is whether that database showed up in your
list of
DB2 datasources. If it is showing up, try just passing
the
DataSource
Name in the $dsn portion of the connect string:
=20
my $dsn =3D 'USNETAALDSN2';
my $dbh =3D DBI->connect("dbi:DB2:$dsn",$user,$pass) or
die
$DBI::errstr;
=20
According to perldoc DBD::DB2, your format is correct
for=20
an
un-cataloged database. I'm wondering if the database=20
name on
the OS/390
box is different from the alias that you have cataloged
on your
local
box, since this format uses the database name on the=20
host, not
the DSN
name that as it's cataloged on the client.
=20
--
=20
------------------------------------------------------------ ------------
--------------------------------------
The darkest places in hell are reserved for those who=20
maintain
their
neutrality in times of moral crisis.
Dante Alighieri (1265 - 1321)
=20
They who would give up an essential liberty for
temporary
security,
deserve neither liberty or security.
Benjamin Franklin
=20
Our lives begin to end the day we become silent about=20
things
that
matter.
Martin Luther King
=20
The right of the people to be secure in their persons,=20
houses,
papers,
and effects, against unreasonable searches and
seizures,=20
shall
not be
violated, and no warrants shall issue, but upon
probable=20
cause,
supported by oath or affirmation, and particularly=20
describing
the place
to be searched, and the persons or things to be seized.
=20
Amendment IV to the Constitution of the United States
=20
------------------------------------------------------------ ------------
--------------------------------------
=20
=20