In Sqlplus, if there is no up-and-down tool, Sqlplus cannot scroll up the history command like a Linux terminal, but Sqlplus records the most recent line of DML statements into buffer, and we can use some simple commands to view, modify, Execute the statement recorded in buffer as follows: L[ist] [n] View buf in Sql:del [n] Remove a row in buf sql:cl[ear] buff[er] Remove BUF in statement: C[hange]/old_value/new_value Represents a change to the first occurrence of the character: In addition, there are I and a, respectively: I[nput] Add new content under the current line, that is, add a row a[ppend] The current line at the end of the above method, in the modification of some simple SQL statement is OK, but if you execute some more complex SQL statements, If we make any changes, we'll have a little bit of trouble, and we can use a text editor like "VI" to make changes to the cached SQL. First, we define which editor we use, with the "VI" editor as an example: after we have defined the editor, we can edit the cached SQL statements like the text with the ED command.
How to view, modify, and execute cached SQL statements in Sqlplus