Re: Oraperl vs Perl

From: John D Groenveld <groenvel_at_cse.psu.edu>
Date: 1998/06/13
Message-ID: <6lukap$mm5$1_at_tholian.cse.psu.edu>#1/1


In article <358045B8.C5C00896_at_shell.com>, Yong Huang <yong_at_shell.com> wrote:
>about open TMP, "|sqlplus usr/pas"; in standard Perl. If it shortens
>development time, is there any specific reason? It formats output better? It
>runs faster? I believe DBI/DBD comes with standard Perl5, doesn't it?

No, its not part of the standard distribution, but apparently they are two of the more popular modules on the Comprehensive Perl Archive Network (CPAN) http://www.cpan.org/

Off the top of my head,

open SQL, "| sqlplus usr/pasw";
print SQL "spool myout\n";
print SQL "select * from employee\n";
print SQL "exit\n";

requires forking another process to connect to Oracle and then parsing the output.

use DBI;  

my $dbh = DBI->connect("dbi:Oracle:", "scott", "tiger", {RaiseError=>1}) my $sth = $dbh->prepare("SELECT * FROM emp"); $sth->execute();
my _at_row;
while (_at_row = $sth->fetchrow_array) {

    ...
}
$sth->finish;
$dbh->disconnect;

John
groenveld_at_acm.org Received on Sat Jun 13 1998 - 00:00:00 CEST

Original text of this message