Home > Database > Mysql Tutorial > body text

常用的ORACLE set和col命令

WBOY
Release: 2016-06-07 17:45:43
Original
1458 people have browsed it

SQL> set timing on;          //设置显示“已用时间:XXXX”

  SQL> set autotrace on-;    //设置允许对执行的sql进行分析

  SQL> set trimout on; //去除标准输出每行的拖尾空格,缺省为off

  SQL> set trimspool on; //去除重定向(spool)输出每行的拖尾空格,缺省为off

  SQL> set echo on               //设置运行命令是是否显示语句

  SQL> set echo off; //显示start启动的脚本中的每个sql命令,缺省为on

  SQL> set feedback on;       //设置显示“已选择XX行”

  SQL> set feedback off;      //回显本次sql命令处理的记录条数,缺省为on

  SQL> set colsep' '; //输出分隔符

  SQL> set heading off;    //输出域标题,缺省为on

  SQL> set pagesize 0;     //输出每页行数,缺省为24,为了避免分页,可设定为0。

  SQL> set linesize 80;     //输出一行字符个数,缺省为80

  SQL> set numwidth 12;     //输出number类型域长度,缺省为10

  SQL> set termout off;    //显示脚本中的命令的执行结果,缺省为on

  SQL> set serveroutput on;  //设置允许显示输出类似dbms_output

  SQL> set verify off                     //可以关闭和打开提示确认信息old 1和new 1的显示.

  备注 一下是column命令

  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]

  下面就举例说明:

  SQL> COLUMN SAL ALIAS Salary FORMAT $99,990.90

  我们指定了SAL这个列的一个别名和数字的MONEY显示格式。

  SQL> col title format a20;

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template