Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Antw: RE: PERL?

Antw: RE: PERL?

From: Markus Reger <reger_at_mdw.ac.at>
Date: Wed, 10 Dec 2003 01:49:27 -0800
Message-ID: <F001.005D9558.20031210014927@fatcity.com>


experienced the following things useful - on unix/bsd/linux - sqlplus / << EOF
connect sys as sysdba
startup
EOF things like that can be put into shell scripts - eg as startup scripts, for cron jobs doing e.g. reports into .pdf's to store on a webserver,....

perl's expect will most likely work like the unix expect. consider autoexpect as a beginner.

we have oracle on NT as well. but it will be migrated to solaris and shut down within weeks. basically everything that works on unix/linux works in MS as well. if you can and want you can install cygwin or unixtools for nt. OR you use perl altogehter - but won't find to many tested ready scrits for it.

my 5€c.
kr MReger

>>> hanksdc_at_about-inc.com 12/09 10:29 >>> On Tue, 9 Dec 2003, Yong Huang wrote:

> Speaking of Perl versus shell, Perl may still be quite primitive in supporting
> two-way communication with an external program e.g. sqlplus. (I have an example
> at www.stormloader.com/yonghuang/computer/OracleAndPerl.html#2waytosqlplus
> using IPC::Open2). But I think a KornShell coprocess (not a here document) does
> it nicely, i.e. piping a SQL command in and reading the result back, piping
> another command in, reading again, without exiting your sqlplus session. If you
> use Perl DBI (or the old OraPerl), Jared may know this but I'm not sure if you
> can send any arbitary SQL command such as explain plan, shutdown... and read
> its output.

I think Perl with Expect.pm could likely do this without much effort. Expect allows you to interact with just about anything that uses a terminal. One fun case comes to mind. We have this LED sign (think large rectangular array of LEDs), with an undocumented serial interface protocol. All that came with it to control it was this old DOS program which would talk to the sign over a serial port. So I whipped up a Perl script which used Expect to interact with dosemu (a Linux DOS emulator) to run the program, which interacted with the sign, all running on Linux. Works pretty good.

Expect.pm is also nice to interact with network hardware that offers telnet/shell command interfaces. Interacting with sqlplus via Expect.pm would be pretty easy as well, I would think. It basically works like this:

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com 
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Markus Reger
  INET: reger_at_mdw.ac.at

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Dec 10 2003 - 03:49:27 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US