Today we want to tell you about the Oracle set and col commands. The Oracle Database's set is too fragmented. Here we will summarize it. The following is a detailed summary of its related content, if you are interested in related content, you can click to view the following articles.
SQL> set timing on; // set to display "time in use: XXXX"
SQL> set autotrace on-; // set to allow analysis of executed SQL statements
SQL> set trimout on; // Remove trailing spaces in each row of the standard output. The default value is off.
SQL> set trimspool on; // remove redirection spool) Output trailing spaces of each row. The default value is off.
SQL> set echo on // set whether to display the statement when running the command
SQL> set echo off; // displays each SQL command in the start script. The default value is on.
SQL> set feedback on; // The "XX rows selected" is displayed"
SQL> set feedback off; // display the number of records processed by this SQL command. The default value is on.
SQL> set colsep ''; // output delimiter
SQL> set heading off; // output domain title, on by default
SQL> set pagesize 0; // number of output lines per page. The default value is 24. To avoid paging, you can set the value to 0.
SQL> set linesize 80; // output the number of characters in a row. The default value is 80.
SQL> set numwidth 12; // The length of the output number field. The default value is 10.
SQL> set termout off; // displays the execution results of commands in the script. The default value is on.
SQL> set serveroutput on; // set to allow display of output similar to dbms_output
SQL> set verify off // you can close or open the prompt to confirm the display of information old 1 and new 1.
The column command
- COL[UMN] [{column | expr} [option...] ]
- where option is one of the following clauses:
- ALI[AS] alias
- CLE[AR]
- ENTMAP {ON|OFF}
- FOLD_A[FTER]
- FOLD_B[EFORE]
- FOR[MAT] format
- HEA[DING] text
- JUS[TIFY] {L[EFT] | C[ENTER] | C[ENTRE] | R[IGHT]}
- LIKE {expr | alias}
- NEWL[INE]
- NEW_V[ALUE] variable
- NOPRI[NT] | PRI[NT]
- NUL[L] text
- OLD_V[ALUE] variable
- ON|OFF
- WRA[PPED] | WOR[D_WRAPPED] | TRU[NCATED]
The following is an example:
- SQL> COLUMN SAL ALIAS Salary FORMAT $99,990.90
We specify the MONEY display format of an individual name and number in the column SAL.
- SQL> col title format a20;
The above content describes the Oracle set and col commands, hoping to help you in this regard.