[20120705]sqlplus 的column xxx noprint.txt

lfree發表於2012-07-06
sqlplus中有時候某列很長,不想顯示,一般使用column xxx format a10,限制輸出的長度。
實際上column 還可以加入引數noprint,使該行不顯示,例子如下:


SQL> help column

 COLUMN
 ------

 Specifies display attributes for a given column, such as:
     - text for the column heading
     - alignment for the column heading
     - format for NUMBER data
     - wrapping of column data
 Also lists the current display attributes for a single column
 or all columns.

 COL[UMN] [{column | expr} [option ...] ]

 where option represents 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] | 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 hiredate clear
SQL> column hiredate noprint
SQL> select * from emp  where empno='7369';
     EMPNO ENAME      JOB              MGR        SAL       COMM     DEPTNO
---------- ---------- --------- ---------- ---------- ---------- ----------
      7369 SMITH      CLERK           7902        800                    20

SQL> column hiredate print
SQL> select * from emp  where empno='7369';
     EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
---------- ---------- --------- ---------- ------------------- ---------- ---------- ----------
      7369 SMITH      CLERK           7902 1980-12-17 00:00:00        800                    20

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-734807/,如需轉載,請註明出處,否則將追究法律責任。

相關文章