Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / August 2006

Tip: Looking for answers? Try searching our database.

Any Perl / DB2 knowledgeable people out there?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tomas - 23 Aug 2006 00:08 GMT
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?

thanks,

/T
Darin McBride - 23 Aug 2006 00:17 GMT
> Hey all,
>
[quoted text clipped - 5 lines]
> 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();
[quoted text clipped - 8 lines]
>
> 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.
Tomas - 23 Aug 2006 00:34 GMT
Constants!  Brilliant!  That did the trick.  I did use strict, but I
didn't think to use Constants.

Thanks!

/T

> > Hey all,
> >
[quoted text clipped - 32 lines]
> Of course, you may already be doing both of these, but just didn't put them
> in your snippet.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.