By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,236 Members | 1,449 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,236 IT Pros & Developers. It's quick & easy.

Any Perl / DB2 knowledgeable people out there?

P: n/a
Hey all,

I'm trying to parse the output from the get_dbsize_info procedure with
a Perl script, using the DBI and the DB2 DBD. Below is the relevant
part of the code:

my $dbsql = "call get_dbsize_info(?,?,?,?)";
my $dbsqlh = $dbh->prepare($dbsql);
$dbsqlh->bind_param_inout(1,\$snapshottimestamp,20,{db2_pa ram_type=>SQL_PARAM_OUTPUT});
$dbsqlh->bind_param_inout(2,\$databasesize,20,{db2_param_t ype=>SQL_PARAM_OUTPUT});
$dbsqlh->bind_param_inout(3,\$databasecapacity,20,{db2_par am_type=>SQL_PARAM_OUTPUT});
$dbsqlh->bind_param(4,-1);
$dbsqlh->execute();

The bind_param_inout steps fail with:

DBD::DB2::st bind_param_inout failed: [IBM][CLI Driver] CLI0144E
Invalid parameter type. SQLSTATE=HY105

Not being a developer, I don't have the complete understanding of this.
However, from what I've read, SQL_PARAM_OUTPUT should be valid.

Anyone know what I'm doing wrong?

thanks,

/T

Aug 22 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Tomas wrote:
Hey all,

I'm trying to parse the output from the get_dbsize_info procedure with
a Perl script, using the DBI and the DB2 DBD. Below is the relevant
part of the code:

my $dbsql = "call get_dbsize_info(?,?,?,?)";
my $dbsqlh = $dbh->prepare($dbsql);
$dbsqlh->bind_param_inout(1,\$snapshottimestamp,20
{db2_param_type=>SQL_PARAM_OUTPUT});
$dbsqlh->bind_param_inout(2,\$databasesize,20
{db2_param_type=>SQL_PARAM_OUTPUT});
$dbsqlh->bind_param_inout(3,\$databasecapacity,20
{db2_param_type=>SQL_PARAM_OUTPUT});
$dbsqlh->bind_param(4,-1);
$dbsqlh->execute();

The bind_param_inout steps fail with:

DBD::DB2::st bind_param_inout failed: [IBM][CLI Driver] CLI0144E
Invalid parameter type. SQLSTATE=HY105

Not being a developer, I don't have the complete understanding of this.
However, from what I've read, SQL_PARAM_OUTPUT should be valid.

Anyone know what I'm doing wrong?
I'm not entirely sure, no. But I can make a couple of suggestions.

First, I'm not sure if you are using strict. If not, do so.

Second, you may need to also "use DBD::DB2::Constants;" in your current
namespace.

Of course, you may already be doing both of these, but just didn't put them
in your snippet.

Aug 22 '06 #2

P: n/a
Constants! Brilliant! That did the trick. I did use strict, but I
didn't think to use Constants.

Thanks!

/T

Darin McBride wrote:
Tomas wrote:
Hey all,

I'm trying to parse the output from the get_dbsize_info procedure with
a Perl script, using the DBI and the DB2 DBD. Below is the relevant
part of the code:

my $dbsql = "call get_dbsize_info(?,?,?,?)";
my $dbsqlh = $dbh->prepare($dbsql);
$dbsqlh->bind_param_inout(1,\$snapshottimestamp,20
{db2_param_type=>SQL_PARAM_OUTPUT});
$dbsqlh->bind_param_inout(2,\$databasesize,20
{db2_param_type=>SQL_PARAM_OUTPUT});
$dbsqlh->bind_param_inout(3,\$databasecapacity,20
{db2_param_type=>SQL_PARAM_OUTPUT});
$dbsqlh->bind_param(4,-1);
$dbsqlh->execute();

The bind_param_inout steps fail with:

DBD::DB2::st bind_param_inout failed: [IBM][CLI Driver] CLI0144E
Invalid parameter type. SQLSTATE=HY105

Not being a developer, I don't have the complete understanding of this.
However, from what I've read, SQL_PARAM_OUTPUT should be valid.

Anyone know what I'm doing wrong?

I'm not entirely sure, no. But I can make a couple of suggestions.

First, I'm not sure if you are using strict. If not, do so.

Second, you may need to also "use DBD::DB2::Constants;" in your current
namespace.

Of course, you may already be doing both of these, but just didn't put them
in your snippet.
Aug 22 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.