cmd 执行sql脚本 SQL PLUS命令的使用大全

11/28 10:20:01 来源网站:seo优化-辅助卡盟平台

10 aaa 11

SQL> COLUMN ENAME HEADING ’Employee|Name’

Sql>select * from emp

Employee

Department name Salary

---------- ---------- ----------

10 aaa 11

note: the col heading turn into two lines from one line.

3). 改变列的显示长度:

FOR[MAT] format

Sql>select empno,ename,job from emp;

EMPNO ENAME JOB

---------- ---------- ---------

7369 SMITH CLERK

7499 ALLEN SALESMAN

7521 WARD SALESMAN

Sql> col ename format a40

EMPNO ENAME JOB

---------- ---------------------------------------- ---------

7369 SMITH CLERK

7499 ALLEN SALESMAN

7521 WARD SALESMAN

4). 设置列标题的对齐方式

JUS[TIFY] {L[EFT]|C[ENTER]|C[ENTRE]|R[IGHT]}

SQL> col ename justify center

SQL> /

EMPNO ENAME JOB

---------- ---------------------------------------- ---------

7369 SMITH CLERK

7499 ALLEN SALESMAN

7521 WARD SALESMAN

对于NUMBER型的列,列标题缺省在右边cmd 执行sql脚本,其它类型的列标题缺省在左边

5). 不让一个列显示在屏幕上

NOPRI[NT]|PRI[NT]

SQL> col job noprint

SQL> /

EMPNO ENAME

---------- ----------------------------------------

7369 SMITH

7499 ALLEN

7521 WARD

6). 格式化NUMBER类型列的显示:

SQL> COLUMN SAL FORMAT $99,990

SQL> /

Employee

Department Name Salary Commission

---------- ---------- --------- ----------

30 ALLEN $1,600 300

7). 显示列值时,如果列值为NULL值,用text值代替NULL值

COMM NUL[L] text

SQL>COL COMM NUL[L] text

8). 设置一个列的回绕方式

WRA[PPED]|WOR[D_WRAPPED]|TRU[NCATED]

COL1

--------------------

HOW ARE YOU?

SQL>COL COL1 FORMAT A5

SQL>COL COL1 WRAPPED

    暂无相关资讯
cmd 执行sql脚本 SQL PLUS命令的使用大全