Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Run command on sqlplus repetitively without reconnection.
On 5/9/07, Radoulov, Dimitre <cichomitiko_at_gmail.com> wrote:
>
> } I want to run a command on sqlplus without making re-connection. At the
> } same time I also want to see the output.
>
> With ksh93 (and pdksh, on Linux for example) you can use co-processes:
>
I once wrote a set of shell scripts to do SQL commands from the shell command line using co-processes.
There are some rather tricky bits to using sqlplus in a co-process, and I don't think it was really worth the trouble, given the simplicity of using sqlplus in the regular manner.
Once a job exceeds 50 or so lines of shell script, and/or requires some convoluted scripting, I just use perl. Much simpler and cleaner.
And if it is a job is all done in a single database, I just use PL/SQL or
SQL.
Anything requiring simultaneous multiple db connections is also done in
Perl,
as you can't do it easily with shell and sqlplus.
Sorry Neil O. if perl makes your head hurt. I guess you will just have to continue doing things the hard way. :)
-- Jared Still Certifiable Oracle DBA and Part Time Perl Evangelist -- http://www.freelists.org/webpage/oracle-lReceived on Wed May 09 2007 - 19:39:35 CDT
![]() |
![]() |