473,746 Members | 2,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Any Perl / DB2 knowledgeable people out there?

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_ino ut(1,\$snapshot timestamp,20,{d b2_param_type=> SQL_PARAM_OUTPU T});
$dbsqlh->bind_param_ino ut(2,\$database size,20,{db2_pa ram_type=>SQL_P ARAM_OUTPUT});
$dbsqlh->bind_param_ino ut(3,\$database capacity,20,{db 2_param_type=>S QL_PARAM_OUTPUT });
$dbsqlh->bind_param(4 ,-1);
$dbsqlh->execute();

The bind_param_inou t steps fail with:

DBD::DB2::st bind_param_inou t 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_OUTPU T should be valid.

Anyone know what I'm doing wrong?

thanks,

/T

Aug 22 '06 #1
2 2887
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_ino ut(1,\$snapshot timestamp,20
{db2_param_type =>SQL_PARAM_OUT PUT});
$dbsqlh->bind_param_ino ut(2,\$database size,20
{db2_param_type =>SQL_PARAM_OUT PUT});
$dbsqlh->bind_param_ino ut(3,\$database capacity,20
{db2_param_type =>SQL_PARAM_OUT PUT});
$dbsqlh->bind_param(4 ,-1);
$dbsqlh->execute();

The bind_param_inou t steps fail with:

DBD::DB2::st bind_param_inou t 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_OUTPU T 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::Const ants;" 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
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_ino ut(1,\$snapshot timestamp,20
{db2_param_type =>SQL_PARAM_OUT PUT});
$dbsqlh->bind_param_ino ut(2,\$database size,20
{db2_param_type =>SQL_PARAM_OUT PUT});
$dbsqlh->bind_param_ino ut(3,\$database capacity,20
{db2_param_type =>SQL_PARAM_OUT PUT});
$dbsqlh->bind_param(4 ,-1);
$dbsqlh->execute();

The bind_param_inou t steps fail with:

DBD::DB2::st bind_param_inou t 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_OUTPU T 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::Const ants;" 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

58
4508
by: @ | last post by:
A benchmark in 2002 showed PHP is much slower in shell or when Apache has Mod_Perl. With the new PHP kissing Java's ass, Perl is once again the #1 CGI choice. Java is for a big team in short time to develope something slow. ASP is a joke. PHP is a kid.
13
2707
by: Wayne Folta | last post by:
I've been a long-time Perl programmer, though I've not used a boatload of packages nor much of the tacky OO. A couple of years ago, I decided to look into Python and Ruby. Python looked OK, but not that different. I did like the indent-as-group idea, which was different. Ruby looked very cool. But it was impossible to get good documentation. It seemed like a Japanese cult with a few western initiates. Well, MacOS X ships with Perl,...
31
4800
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 great for pattern matching, text processing, and automated testing. Our company is really fixated on risk managnemt and the only way I can do enough testing without working overtime (which some people have ended up doing) is by automating my...
0
9744
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. I need it to be compiled with threads. Anyone have any wisdom on how best to do this? Here's a transcript of my latest attempt. It's long; you might want to skip to the bottom, where I try "make" and the fatal errors start happening.
8
2122
by: vj | last post by:
I've been given a project which requires writing scripts that need to be run on over 3000 servers. Only about 15% of them have python installed on them. While all/most of them will have perl. I'll try and do as much as possible in pexpect but am sure I'll have do some significant perl. Any suggestions on what is the best way to get upto speed on perl?
20
2214
by: Shawn Milo | last post by:
I'm new to Python and fairly experienced in Perl, although that experience is limited to the things I use daily. I wrote the same script in both Perl and Python, and the output is identical. The run speed is similar (very fast) and the line count is similar. Now that they're both working, I was looking at the code and wondering what Perl-specific and Python-specific improvements to the code would look like, as judged by others more...
6
3011
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 for one of the Pear modules for creating XML and it didn't look like much. I've used Perl XML:Twig and I have the impression that there is more Perl stuff available as well as the Perl stuff being well documented as I have a Perl DBI book, a Perl...
21
34430
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 obvious of which is the sharing of files. For example, you upload images to a server to share them with other people over the Internet. Perl comes ready equipped for uploading files via the CGI.pm module, which has long been a core module and allows users...
1
47476
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 on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
0
8974
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8800
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9285
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6772
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4575
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4836
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3292
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2199
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.