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)

Wednesday October 02, 2002
10:33 AM

Coding judo

[ #8131 ]

I'm currently working on Microsoft SQL Server 2000, using something called Data Transformation Services, or DTS. It's basically MS trying to work into the data warehouse market, by edging out competitors like Informatica.

You build a DTS package out of components, which do things like establish connections, execute SQL, transform columns, etc. One component allows you to write scripts using VBScript or JScript, or if you install it yourself, Perlscript. Guess which I picked.

Well, in typical MS fashion, the software doesn't do everything that the documents claim. In some cases you have to read very carefully, because the wording seems to be precisely crafted to make it sound like it does more than it actually says. After two days of struggle to make Perlscript work in that environment, yesterday I gave up and decided to try writing VBScript. Well, I'd forgotten a lot of how (badly) it worked, so I figured I'd write some small tests to make sure that what I wanted would work at all. Small surprise, it did seem to work in VBScript, if I copied their example code carefully.

So what was the problem? I decided to go back and carefully re-craft the code from VBScript to Perl. I found that this resulted in code slightly different from what I had written previously, mainly due to not fully understanding how Win32::OLE implements the COM interfaces. (Should I use $obj->{foo}->Value? or $obj->foo()? or ...) When I got it to work, I quickly tucked away its guts in a module, and verified I could call from it DTS. Hallelujah! Free at last! I can now re-use the code without copying-and-pasting, and without putting up with VBScript.

So, boys and girls, remember: sometimes the way to win is by giving in first, then turning it to your advantage.

BTW, I have to mention: if you're going to try anything with Win32::OLE, the best resource I've found is Dave Roth's web site. Invaluable information, in the form of tips and example. Thank you, Dave!

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.