Re: Oracle Interaction From Shell
From: William Park (opengeometry_at_yahoo.ca)
Date: 04/22/05
- Next message: William Park: "Re: bash: Can I access the raw command line?"
- Previous message: Chris F.A. Johnson: "Re: passing parameters to alias"
- In reply to: Chris: "Oracle Interaction From Shell"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 22 Apr 2005 17:57:54 -0400
Chris <ctaliercio@yahoo.com> 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
> cumbersome.
>
> 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
things from
http://home.eol.ca/~parkw/index.html#sqlite
http://home.eol.ca/~parkw/index.html#postgresql
http://home.eol.ca/~parkw/index.html#mysql
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 <opengeometry@yahoo.ca>, Toronto, Canada Slackware Linux -- because it works.
- Next message: William Park: "Re: bash: Can I access the raw command line?"
- Previous message: Chris F.A. Johnson: "Re: passing parameters to alias"
- In reply to: Chris: "Oracle Interaction From Shell"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|