Re: Run command on sqlplus repetitively without reconnection
- From: "Senthil Subramanian" <skumar.sen@xxxxxxxxx>
- To: "David Taft" <oradbt054@xxxxxxxxx>
- Date: Mon, 21 May 2007 22:29:04 -0400
David,
You should try with 'print -p exit' instead of 'print -f exit' inside the
trap. The 'print -p exit' command will send the SQL*Plus command EXIT to
the co-process when you press Ctrl-C. In this way, you could gracefully
exit from SQL*Plus instead of killing your session.
Thanks,
Senthil.
On 5/21/07, David Taft <oradbt054@xxxxxxxxx> wrote:
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@xxxxxxxxx> wrote:
>
> You could try 'print -p exit; exit;' in the trap command to exit
> gracefully from both SQL*Plus and the shell.
>
- References:
- Re: Run command on sqlplus repetitively without reconnection
- From: David Taft
- Re: Run command on sqlplus repetitively without reconnection
- From: Senthil Subramanian
Other related posts:
- » Run command on sqlplus repetitively without reconnection.
- » RE: Run command on sqlplus repetitively without reconnection.
- » RE: Run command on sqlplus repetitively without reconnection.
- » RE: Run command on sqlplus repetitively without reconnection.
- » RE: Run command on sqlplus repetitively without reconnection.
- » RE: Run command on sqlplus repetitively without reconnection.
- » RE: Run command on sqlplus repetitively without reconnection.
- » RE: Run command on sqlplus repetitively without reconnection.
- » RE: Run command on sqlplus repetitively without reconnection.
- » Re: Run command on sqlplus repetitively without reconnection.
- » RE: Run command on sqlplus repetitively without reconnection.
- » RE: Run command on sqlplus repetitively without reconnection.
- » Re: Run command on sqlplus repetitively without reconnection.
- » RE: Run command on sqlplus repetitively without reconnection.
- » Re: Run command on sqlplus repetitively without reconnection.
- » Re: Run command on sqlplus repetitively without reconnection.
- » RE: Run command on sqlplus repetitively without reconnection.
- » Re: Run command on sqlplus repetitively without reconnection.
- » Re: Run command on sqlplus repetitively without reconnection.
- » RE: Run command on sqlplus repetitively without reconnection.
- » RE: Run command on sqlplus repetitively without reconnection.
- » Re: Run command on sqlplus repetitively without reconnection.
- » Re: Run command on sqlplus repetitively without reconnection.
- » Re: Run command on sqlplus repetitively without reconnection
- » Re: Run command on sqlplus repetitively without reconnection
- » Re: Run command on sqlplus repetitively without reconnection
- » Re: Run command on sqlplus repetitively without reconnection
- » Re: Run command on sqlplus repetitively without reconnection
- » Re: Run command on sqlplus repetitively without reconnection
- » Re: Run command on sqlplus repetitively without reconnection
- » Re: Run command on sqlplus repetitively without reconnection
- » Re: Run command on sqlplus repetitively without reconnection
- » Re: Run command on sqlplus repetitively without reconnection
- » Re: Run command on sqlplus repetitively without reconnection
- » Re: Run command on sqlplus repetitively without reconnection
- » Re: Run command on sqlplus repetitively without reconnection
- » Re: Run command on sqlplus repetitively without reconnection
- » RE: Run command on sqlplus repetitively without reconnection
- » Re: Run command on sqlplus repetitively without reconnection
- » RE: Run command on sqlplus repetitively without reconnection
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@xxxxxxxxx> wrote: > > You could try 'print -p exit; exit;' in the trap command to exit > gracefully from both SQL*Plus and the shell. >
- Re: Run command on sqlplus repetitively without reconnection
- From: David Taft
- Re: Run command on sqlplus repetitively without reconnection
- From: Senthil Subramanian