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…
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.
It also has the EDIT command.
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.
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.
[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]? >