Re: Oracle Interaction From Shell
From: William Park (opengeometry_at_yahoo.ca)
Date: Fri, 22 Apr 2005 17:57:54 -0400
Chris <firstname.lastname@example.org> wrote:
> Does anyone know of a method, other than a sqlplus "here" document,
> that can be used to interact with Oracle from a UNIX shell?
> What I'd like to do is establish a connection and use it throughout the
> execution of a shell script in order to query and update the database.
> Using "here" documents to sqlplus can be quite expensive if the
> functions are executed often.
> I've considered using a co-process, but it seems that parsing the
> results to find out whether the command succeeded or not would be quite
> I also know that I could use Pro*C, but a lot of what I am doing in the
> shell script is somewhat of a PITA to incorporate within a C program.
> Much easier/simpler to use shell.
> Any thoughts from the group?
I can't help you w.r.t. Oracle. But, you may be able to borrow few
Essentially, you build SQL strings, send it to database, and get the
results back (if any) in shell array variable. You can do the same
thing using client programs (ie. sqlite, mysql, psql), but you would
need to re-parse the result, which tends to be pain.
I've been meaning to add Oracle interface, but I couldn't find the
source for Oracle, and more importantly API documentations.
-- William Park <email@example.com>, Toronto, Canada Slackware Linux -- because it works.