On Mon, 25 Aug 2003 06:48:11 -0700, Kenjis Kaan wrote:
Quote:
Anyone know where I can get information on connecting Perl4 to DB2? I
know its easy with the newer version of perl, but I have a need to use
Perl4 to connect to DB2. |
Don't think the DBI and DBD:

B2 functions were available under Perl 4.
If you really can't upgrade to Perl 5 (why not ? the source is free) then
you could use the following kludgy method -
my $sql = "db2 'connect to dbname';db2 'select * from
sysibm.systables';db2'connect reset'";
my $results = `$sql`;
then process the results out of the $results variable.
Not nice, but it does work.
You have to do this if you want to run DB2 utilities within Perl anyway
(unless someone builds a module to wrap them).
Note that you need the connect, SQL and disconnect all in one statement.
Because the backticks spawn a new process the connection is (should be :
this doesn't happen with Linux) terminated when the backticks command
ends. So it won't be efficient either (among other things you want to
make sure the database is activated to stop having to set up and tear down
resources every time if this is low usage).
HTH
Phil
HTH
Phil