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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Run command on sqlplus repetitively without reconnection

Re: Run command on sqlplus repetitively without reconnection

From: David Taft <oradbt054_at_gmail.com>
Date: Mon, 21 May 2007 11:53:45 -0400
Message-ID: <69b058e80705210853u51144d00o13cb94bbd34020b2@mail.gmail.com>


Senthil,

Unfortunately the sqlplus session was still running in the background when I tried the 'print -f exit' inside the trap. However, that got me rethinking the problem. What worked was the the following:

trap 'kill %2;kill %1;exit' 1 2 3 15

I realized that I had two background jobs running, the sqlplus session and the first while loop containing the SQL. So the trick was to kill the first while loop (%2), then the sqlplus (%1) and finally exit the second while loop. No errors now when I Ctl-C and no background processes left running.

Thanks for your feedback, it did help.

David

On 5/18/07, Senthil Subramanian <skumar.sen_at_gmail.com> wrote: You could try 'print -p exit; exit;' in the trap command to exit gracefully from both SQL*Plus and the shell.

--
http://www.freelists.org/webpage/oracle-l
Received on Mon May 21 2007 - 10:53:45 CDT

Original text of this message

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