Does this look familiar?
All over Linux you can use arrow up to get the latest command and edit it. But not in SQL*Plus! Something I used to forget many times a day…
I was recently in a presentation where the presenter had a really bad day – typing-wise, that is. He kept making typos all the time and he always ended up copying the text over in an editor, do the changes, and paste back. In the end you could really feel his frustrations (even though it was a virtual presentation). I really felt with that guy, probably because it could just as well be me. Oh, that feeling you get after typing a lengthy SQL only to find a stupid typo!!!
I gave up on my typing skills a long time ago and I am now happy user of SQLcl. So when I make a typo I just do this:
But I still meet a lot of people that are stuck in the last millenium aka SQL*Plus. So, the big question is:
Why aren’t you using SQLcl?
With the alias function in SQLcl I can do this:
With tab completion I can do this:
And look at the beautifully formatted query result I get in SQLcl using
set sqlformat ansiconsole:
Still not convinced? Check out this post from fellow Product Manager Jeff Smith in which he sells you SQLcl in 1 minute.
May this be the day where you did your last SQL*Plus typo!
For your reference here are the aliases that I used in the demo:
pdbs = select con_id, name, open_mode, restricted from v$pdbs order by con_id sc = exec execute immediate 'alter session set container='||:one scr = alter session set container=CDB$ROOT ts = select p.con_id, p.name, vt.name, ct.encrypted, ct.status, ct.contents, ct.compress_for from v$tablespace vt, v$pdbs p, cdb_tablespaces ct where vt.con_id=p.con_id(+) and vt.name = ct.tablespace_name(+) and vt.con_id = ct.con_id (+) order by vt.con_id, vt.name