SQL Buffer for SQL/PLUS Study Notes

Source: Internet
Author: User

SQL/PLUS Study NotesOfSQL BufferThis is what we will introduce in this article. Next we will introduce it one by one, hoping to get some benefits for you!

SQL Buffer

(1). Store only one SQL command;

(2) The save command outputs the SQL command in the current SQL Buffer to a file with a specified file name on the disk;

Eg: SQL> save c:/hr press enter and then generate the hr. SQL file on drive c.

(3). list command: displays the SQL command in the current SQL Buffer;

(4 ). run and/(slash-diagonal line) run SQL commands in SQL Buffer. The former displays the SQL commands to be executed and then the running results, while the latter directly displays the running results;

(5). To display the print result on the sqlplus terminal, you must set the parameter serveroutput.

 
 
  1. SQL> show serveroutput  
  2. serveroutput OFF 

As you can see, serveroutput is disabled. Use the following command to set the status to open:

 
 
  1. SQL> set serveroutput on  
  2. SQL> show serveroutput  
  3. serveroutput ON SIZE UNLIMITED FORMAT WORD_WRAPPED 

Eg:

 
 
  1. SQL> declare  
  2. x varchar2(15) :='Hello World !';  
  3. begin  
  4. dbms_output.put_line(x);  
  5. exception  
  6. when others then  
  7. dbms_output.put_line('Error!');  
  8. end; 
 
 
  1. SQL> list  
  2. declare  
  3.  x varchar2(15) :='Hello World !';  
  4. begin  
  5. dbms_output.put_line(x);  
  6. exception  
  7. when others then  
  8. dbms_output.put_line('Error!');  
  9. * end;

The usage of SQL Buffer in SQL/PLUS learning notes will be introduced here. I hope this introduction will be helpful to you!

Related Article

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.