Forum Stats

  • 3,733,825 Users
  • 2,246,827 Discussions
  • 7,856,887 Comments

Discussions

Sqlcl Repeat command question: how to break out in the middle of loop?

User_A36HO
User_A36HO Member Posts: 40 Red Ribbon
edited October 2017 in SQLcl

Hello,

Let's say i am in "sqlcl" and issued REPEAT command:

SET sqlformat ansiconsole

SELECT systimestamp FROM dual;

repeat 15 120

But then i want to break out of this loop and get the SQL> prompt back.

How does this work?

I was trying different combinations of Ctrl-C, Ctrl-\,etc. - none of these worked to allow me get out of the REPEAT command.

Please advise.

Best,

vr

Answers

  • Gary Graham-Oracle
    Gary Graham-Oracle Member Posts: 3,256 Bronze Crown
    edited October 2017

    Just tried this on the latest SQLcl available on OTN...

    Command Line - SQLcl 17.3

    September 29, 2017 - Update 17.3.0.271.1943

    It works, but the Ctrl+C interrupt is not processed until the current sleep cycle ends.  Try REPEAT 10 10. It is a bit easier to endure.

  • user468437
    user468437 Member Posts: 6 Blue Ribbon

    I know handling signals is messy, but would really like to be able to keep a tail running semi-indefinitely and interrupt it when time. I guess Ctrl-C getting all the way back out to the shell is better than nothing.

    PS

    I tried changing stty intr, but apparently sql.exe is putting it back to ctrl-C when it starts or not paying attention to the stty settings at all.

    Since nobody seems to have complained since 2017, hard to see this as a priority.

Sign In or Register to comment.