How to view, modify, and execute cached SQL statements in Sqlplus

Source: Internet
Author: User
Tags sqlplus
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.