The third day of Oracle learning [sqlplus Common commands]

Source: Internet
Author: User
Tags clear screen dname

Common sqlplus commands

SQL> Help Index

Enter help [Topic]

Copy pause Shutdown

Define print Spool

Del prompt sqlplus

Describe quit start

Disconnect recover startup

Archive log
Edit remark store

Execute repfooter timing

Exit repheader ttitle

Get Reserved Words
(SQL) undefine

Help Reserved Words
(PL/SQL) Variable

Host run whenever oserror

Input save whenever sqlerror

List Set

Password show

1. Clear screen command

SQL> clear screen

2. List table information


Is the name empty? Type


Empno not null
Number (4)

Varchar2 (10)

Varchar2 (9)

Mgr number (4)

Hiredate date

Number (7,2)

Number (7,2)

Deptno number (2)

SQL> conn Scott/Tiger


3. Execute the command (start filename (PATH), @ filename (PATH) in the file ))

SQL> Start J: \ disk1 \ SQL \ 1. SQL

Deptno dname Loc


10 Accounting New York

20 research Dallas

30 sales Chicago

40 operations Boston

SQL> @ J: \ disk1 \ SQL \ 1. SQL

Deptno dname Loc


10 Accounting New York

20 research Dallas

30 sales Chicago

40 operations Boston

4. Obtain the commands in the (edit) File

SQL> get J: \ disk1 \ SQL \ 1. SQL

1 *
Select * from Dept

Edit: enables you to quickly leave sqlplus and enter the selected editor.

SQL> edit J: \ disk1 \ SQL \ 1. SQL

5. Save the buffer command to the file.


File Created

C: \ Documents ents and Settings \ Administrator

6. Save the subsequent operations to the disk.

SQL> spool // displays the current offline status

Not offline

SQL> spool Feng // Save the subsequent operations to the Feng.. LST file.

SQL> spool off // stop output

7. Execute the commands in the Current Buffer



SQL> r

8. List the Current Buffer commands

SQL> List

SQL> List N // list the nth command

SQL> List M N // list m to N commands

SQL> L // short for list

9. Delete the current row.

SQL> Del

SQL> Del n

10. set command

SQL> set sqlprompt "Feng #" // set the default prompt

Feng #

SQL> set timing on // set to display query time consumption. The default value is off.

SQL> set linesize 1000 // sets the screen display width. The default value is 100.

SQL> set pause on // set pause to pause the screen display. Press enter to display

SQL> set heading off // disable the output column title. The default value is on.

SQL> set feedback off // disable counting feedback of the last row. The default value is 6.

SQL> set autocommint on // sets automatic submission. The default value is off.

SQL> set colsep "|" // sets the default setting for separating columns and columns by spaces in the result of executing select output.

11. show command

12. Other commands

HOST: sends commands to the main operating system.

Define_editor: tells sqlplus The Name Of The editor you selected.

Exit or quit: Terminate sqlplus.

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: 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.