Sqlplus setting in the screen does not print out output

Source: Internet
Author: User
Tags html tags sqlplus

In some specific cases we want to do some kind of experiment, we need to execute a SQL statement, but we don't want to print out the result of the SQL statement on the screen (too long)
You can use the following methods.
1 Write the statement you want to execute into a SQL script, for example:
[Email protected] scripts]$ more Sqlt.sql
Set term off
Alter session set Sql_trace=true;
SELECT * from V$latch;
Alter session set Sql_trace=false;
2 Note that the beginning of the script is set
Set term off


The explanation for the set command is as follows:

Column
Modify column widths
Column C1 Format A20--Adjust column C1 (character) display maximum width to 20 characters
Column C1 Format 9999999--Adjusts the maximum width of the C1 (NUM type) display to 7 characters
Modify column headings
Column C1 Heading C2--Output C1 column name to C2

Set Colsep '      --delimiter for row header column
Set linesize--Sets the maximum line width   the sqlplus output;
Set pagesize      --The maximum number of rows in the Set page defaults to 24, to avoid paging, set to 0
set serveroutput on|off
Set Echo on --Displays each command in the file and its execution result, default to ON 
Set echo off--does not display the command in the file, only displays its execution result
Set term on --the query results are displayed in the spool file ( SPOOL specifies the output of the file), and in the Sqlplus display
set term off--the query results are displayed only in the spool file (spool specified output file)
Set heading off --Let the title of the result row not display, default to on 
Set heading on  --Let the title of the result row display
Set trimout on-removes trailing spaces for each line of the standard output, by default off 
Set Trimspool on- -Remove the trailing space of the redirect (spool) output per line, default to OFF&NBSP,
Set timing off  -shows the time-consuming of each SQL command, default to OFF 
Set Verify Off   -whether to show statements before and after substitution variables are replaced.
exit            --Exit

Set Feedback
There are three ways: the default is on
Set Feedback on;set Feedback off;set Feedback n
By default, when a SQL is issued, Oracle gives a feedback, such as when creating a table, if successful, the command line returns a similar: Table created feedback, or when performing a PL/SQL success, the command line returns: PL/SQL procedure Successfully completed. When running many statements in a script, feedback is generally set to off.
Set Feedback N: When an SQL statement returns n or more than n rows of records, there will be feedback, for example: Set feedback 5, when the return record equals or more than 5 rows will have a similar 8 rows Selected feedback. If the return row is less than 5, there is no feedback.

Set Define Off
The default "&" in Sql*plus represents an alternative variable, that is, Sql*plus will ask you to enter an alternate value whenever the symbol appears in the command. This means that you cannot enter a string containing the symbol into a database or assign to a variable, such as the string "Sql&plus" system will be understood as a string beginning with "SQL", it will prompt you to enter the value of the alternative variable Plus, if you enter ABC, then the final string into " Sqlabc ".
Set define off this function, "&" as a normal character, as in the above example, the final character is "Sql&plus"

Set define off--turn off substitution variable function
Set define on--Open alternate variable function
Set define $ (not alphanumeric and white space) will override the default variable marker & "$", that is, the original & marker will be inserted as a normal character, and the following character will be the variable, prompting you to enter.

Spool command
Spool filename-Writes the contents of the buffer to the specified file filename
Spool off--Terminate write command

MARKUP
Markup is an environment setting for sql*plus that controls the markup language type of the output. By default, markup defines HTML as a markup language, but the label itself is closed. The set of HTML tags is predefined; You must open the label with the following statement:
SET MARKUP HTML on

Sqlplus setting in the screen does not print out output

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.