If you know how to edit your code in SQL*Plus, you already know how to do it in SQLcl. But I get asked this a lot, do you support EDIT? Do you support CHANGE? And what does SQLcl offer over those?
So let’s tackle the old and then the new…
C/Old/New
SQL*Plus has the C[HANGE] command.
C[HANGE] sepchar old [sepchar [new [sepchar]]]
Changes the first occurrence of the specified text on the current line in the buffer. The buffer has no command history list and does not record SQL*Plus commands.
We support that.

EDIT filename
It also has the EDIT command.
ED[IT] [file_name[.ext]]
where file_name[.ext] represents the file you wish to edit (typically a script).
Invokes an operating system text editor on the contents of the specified file or on the contents of the buffer. The buffer has no command history list and does not record SQL*Plus commands.
Enter EDIT with no filename to edit the contents of the SQL buffer with the operating system text editor.
We support that.


Inline Editing
SQLcl additionally offers an inline editor.
You can go through your history, find what you want, and then just arrow around the buffer, and make live changes. When you’re ready to execute the statement, you can just hit Ctrl+R.

Help Edit
[email protected]? >help edit EDIT --------- Invokes an operation system text editor ON the contents OF the specified file OR ON the contents OF the SQL buffer. ED[IT] [file_name[.ext]] The DEFINE variable _EDITOR can be used TO SET the editor TO USE IN SQLcl, _EDITOR can be SET TO "inline". This will SET the editor TO be the SQLcl editor. This supports the following shortcuts ^R - Run the CURRENT buffer ^W - GO TO top OF buffer ^S - GO TO bottom OF buffer ^A - GO TO START OF line ^E - GO TO END OF line [email protected]? >
9 Comments
I see that CTRL-w is go to top of buffer. I find that the BASH CTRL-w (delete preceding “word” ) is a really nice feature if you are, say, re-executing a grant command, but you want to just replace the target object_name. Is there a sqlcl line editor equivalent for delete preceding word?
Hi,
In the age of IPhones and UX, I am quite surprised to see that Oracle is trying to revive sqlplus. It was not user friendly tool and still it is, what would be the reason to spend resources to such a tool?
I already *LOVED* SQLplus and will love SQLcl even more. But then again, I don’t see the value of IPhones.
that’s ok, neither do I – I have an Android phone 🙂
So, Jeff – SQLcl is cool, but it is still officially an Early Adopter release. It has been EA for a long time – more than a year, I think.
I’m nervous about encouraging my developers to use anything that isn’t OFFICIALLY a supported product. Is that EVER going to happen for SQLcl?
It’s still in Early Adopter. Yes, it’s been a long time. It will be officially made available soon.
I move between SQL Developer, and SQLcl .
The command ^R is different in SQLcl
^R – Run the CURRENT buffer
and SQL Developer
^R – Relpace
It would be really nice if F9 in SQLcl could run current buffer as SQL Developer does
Hi Jeff,
I noticed that using EDIT will create two afiedt.buf files – one in the sqlcl folder (containing the buffer) and one in my user directory (empty). EDIT will always open the empty one in the user directory. Is there any way around this behavior?
Lars I have not had this issue but my log login.sql does
set editf /tmp/sqlbuf.sql
Actually I dynamically set the name to the session.