Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

VSarkiss (704)

VSarkiss
  (email not shown publicly)
Yahoo! ID: vah3sark (Add User, Send Message)

I haven't really taken the time to set this up, but you can look at my home node [perlmonks.org] on Perl Monks.

Journal of VSarkiss (704)

Thursday October 23, 2003
10:37 AM

Extreme Aggravation

[ #15347 ]

To test potential speedups at my current client, I'm writing a couple of huge queries as DB2 embedded SQL-C programs, and the level of tedium is incredible.

For those who have never written this type of program, here's a brief summary: you need to declare a variable of the correct type for each result column and declare an indicator variable for each column that can be null (these are global, the pre-compiler can't keep track of what routine it's in). Then, in the actual fetch, you need to list the variables and indicators, paired, for each column being retrieved. When you have 128 columns in your result set, this gets extremely tedious.

But wait, there's more! I want to print out the row. But C printf insists on knowing whether the variable is an integer or a float or a string. So again I have to match up types carefully. My first attempt yesterday kept dumping core -- go figure.

MAN, do I miss being able to use Perl. I'd give anything to be able to use DBI and just say print join(" ", @$row). Against this backdrop, the discussions I've had about the ups and downs of Class::DBI seem like they were on another planet.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Generate? (Score:2, Insightful)

    Aren't you using perl to generate all of the really tedious bits?
    • Well, the test was a success, so yes, I'll be writing one very soon. ;-)

      I forgot to add that for all that work, what you get in return is a blazingly fast app....

  • Embed a Perl interpreter in your application. :)

    I also like that code generation suggestion.

    --
    J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers