kstock@isfrance.encore.fr (Kevin Stock,MIS,346,) (04/18/91)
Archive-name: database/oracle/oraperl/1991-04-15 Archive-directory: gatekeeper.dec.com:/pub/comp.sources.misc/volume18/oraperl/ [16.1.0.2] Original-posting-by: kstock@isfrance.encore.fr (Kevin Stock,MIS,346,) Original-subject: ORAPERL - Perl access to Oracle databases Reposted-by: emv@msen.com (Edward Vielmetti, MSEN) [ Please let me know if you see this - I've had trouble posting it ] I have just sent to comp.sources.misc a set of usersubs to enable Perl programs to access Oracle databases. To use it, you will need a version of Perl which accepts usersubs (3.0.27 or higher) and the Oracle Pro*C product. It has been tested with Perl v3 and v4 and with Oracle v6 (but should work on v5, and maybe on earlier versions as well). A sample of how you could produce a listing of your telephone directory: format top = Name Phone ==== ===== . format STDOUT = @<<<<<<<<<< @>>>>>>>>>> $name, $phone . die ("You should use oraperl, not perl\n") unless defined &ora_login; $lda = &ora_login("t", "kstock", "password") || die $ora_errstr; $csr = &ora_open($lda, "select * from telno order by name") || die $ora_errstr; while (($name, $phone) = &ora_fetch($csr)) { write; } do ora_close($csr) || die "can't close cursor"; do ora_logoff($lda) || die "can't log off Oracle"; I'd appreciate any comments, bug reports etc. If you find it useful, please let me know what you're doing with it. perl -e 'print "Just another Perl hacker-wannabe :-)"' ,---------------. ,-+-------------. | Kevin Stock | | E N C O R E | | | `-------------+-' kstock@gouldfr.encore.fr `---------------' kstock@gouldfr.UUCP Any opinions expressed are my own, but may be reproduced under the terms of the GNU licence. See the file COPYING at the end of this posting. :-) -- comp.archives file verification gatekeeper.dec.com total 22 -r--r--r-- 1 root system 22326 Apr 10 18:30 part01.Z found oraperl ok gatekeeper.dec.com:/pub/comp.sources.misc/volume18/oraperl/