Forum Stats

  • 3,874,415 Users
  • 2,266,731 Discussions


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

User_A36HO Member Posts: 40 Red Ribbon
edited Oct 2, 2017 12:00PM in SQLcl


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.




  • Gary Graham-Oracle
    Gary Graham-Oracle Member Posts: 3,256 Bronze Crown
    edited Oct 2, 2017 12:00PM

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

    Command Line - SQLcl 17.3

    September 29, 2017 - Update

    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: 7 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.


    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.