c2d has asked for the wisdom of the Perl Monks concerning the following question:

I need to be able to pass SQL statements to the DB2 client interface and read the results as they are generated for furthur evaluation. I have used open2 and open3 before. What I have been unable to do is get the DB2 client environment correctly invoked. If I were on a unix platform I would use the .profile info to get this interface. However, this is Win2k and I have had NO success getting the environment correctly initialized?!?!?!?!? I am using the most current version of Active States perl for windows, on Windows 2000, DB2 7.1 enterprise edition.

Replies are listed 'Best First'.
Re: Processing SQL thru DB2 interface
by Aristotle (Chancellor) on Jul 14, 2002 at 21:54 UTC

    Your question is a bit vague, but it sounds like what you want to know about is the %ENV hash; see the perlvar documentation. If that's not what you wanted, you need to clarify your question.

    However, may I possibly interest you in using the excellent DBI module?

    Makeshifts last the longest.

      My apologies if this seems vague. Yes I would love to use the DBI(used often in past) however, the DB2 system is on MVS. OOPs sorry DBI not allowed!! I checked %ENV but have not found the necessary info for getting the DB2 process to hear me properly. The best I have gotten so far is to get a DB2 command window open with NO input( not really thrilled with an uncontrolled window).
        Are you sure? The OS that the server runs on shouldn't make a difference. The DBD::DB2 module accesses it in the same way that the DB2 client program does.
Re: Processing SQL thru DB2 interface
by lachoy (Parson) on Jul 15, 2002 at 01:42 UTC

    Another option: you can use DBD::ODBC if you've already got an ODBC connection setup to the server. IIRC, there are some complications with this too (DB2 client stuff is horribly complicated), but it works great no matter what the server OS is. (I used it to connect to an AS/400 from Win2k with no problem.)

    Chris
    M-x auto-bs-mode