Sqlplus command description

Source: Internet
Author: User

Column
Modify column width
Column C1 format A20 -- Adjust the column C1 (character type) display width to 20 characters
Column C1 format 9999999 -- Adjust the maximum display width of column C1 (Num type) to 7 characters
Modify column title
Column C1 heading C2 -- output the column name of C1 as C2

Set colsep ''-- delimiter of the row title Column
Set linesize (line) -- set the maximum output width of sqlplus
Set pagesize -- set the maximum number of rows on the page to 24 by default. To avoid pagination, set it to 0.
Set serveroutput on | off
Set echo on -- display each command in the file and its execution result. The default value is on
Set echo off -- displays only the execution results of commands not in the file.
Set term on -- the query result is displayed in both the offline files (the files output by Spool) and sqlplus files.
Set term off -- the query result is only displayed in the offline file (the file specified by Spool)
Set heading off -- disable the title of the result line. The default value is on.
Set heading on -- display the title of the result line
Set trimout on -- Remove trailing spaces of each standard output line. The default value is off.
Set trimspool on -- remove the trailing space of the redirection (Spool) output line. The default value is off.
Set timing off -- display the time consumed by each SQL command. The default value is off.
Set verify off -- whether to display the statement before and after substitution variables are replaced.
Exit -- exit

Set feedback
There are three methods: On by default
Set feedback on; Set feedback off; Set feedback n
By default, when an SQL statement is sent, Oracle will give a feedback. For example, if a table is created successfully, the command line returns a feedback similar to table created, for example, when a PL/SQL statement is successfully executed, the command line returns: PL/SQL procedure successfully completed. When many statements are run in the script, the feedback is usually set to off.
Set feedback N: When an SQL statement returns N or greater than N rows of records, there will be feedback, such as: Set feedback 5, when the returned record is equal to or greater than five rows, there will be 8 rows selected. feedback. if less than 5 rows are returned, no such feedback is returned.

Set define off
The default "&" in SQL * Plus indicates the substitution variable. That is to say, as long as the symbol appears in the command, SQL * Plus requires you to enter the substitution value. This means that you cannot input a string containing this symbol into the database or assign it to a variable. For example, the string "SQL & plus" system will understand it as a string with the "SQL" header, it prompts you to enter the value of the substitution variable plus. If you enter ABC, the final string is converted to "sqlabc ".
Set define off disables this function. "&" is used as a common character. In the preceding example, the final character is "SQL & plus"

Set define off -- disable the substitution Variable Function
Set define on -- enable the variable substitution function
Set define $ (not letters, numbers, and spaces) will replace the default variable identifier & as "$", that is, the original & identifier will be inserted in the form of common characters, if the character after $ is a variable, you will be prompted to enter it.

Spool command
Spool filename -- write the buffer content to the specified file filename
Spool off -- terminate write command

Markup
Markup is an environment setting for SQL * Plus, which controls the output Markup Language type. By default, markup defines HTML as a markup language, but the tag itself is disabled. The HTML Tag set is predefined. You must open the tag using the following statement:
Set markup HTML on
See the http://www.jb51.net/web/24903.html for the use of specific HTML language

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.