1

最初のテーブルには長い文字列がなく、出力は適切にフォーマットされています。

SQL> select * from Visit;

       SLOTNUM DATEVISIT ACTUALARR                                                                                     
    ---------- --------- ---------                                                                                     
            12 19-JUN-13 19-JUN-13                                                                                     
            15 20-JUN-13 20-JUN-13                                                                                     
            18 21-JUN-13 21-JUN-13                                                                                     

ただし、2番目のテーブルにはDescription列が含まれており、出力は完全に混乱しています...

SQL> select * from Treatment;

        TREATC NAME                       


    ------ --------------------                                                                                        
    DESCRIPTION                                                                                                        
    -------------------------------------------------------------------------------------------------------------------
    STANDARDFEE                                                                                                        
    -----------                                                                                                        
    WARNINGS                                                                                                           
    -------------------------------------------------------------------------------------------------------------------
    123456 Flu Shot                                                                                                    
    Treats insert into Treatment flu                                                                                   
           20.5                                                                                                        


    123458 Lungs Inhalation                                                                                            
    Treats cough only                                                                                                  
           10.5                                                                                                        
    May increase blood preassure 

で 2 番目のテーブルの見栄えを良くするにはどうすればよいspoolですか?

4

1 に答える 1

2
SQL> SELECT * FROM sqlplus_tbl;

A_DATE
---------
A_VERY_LONG_STRING
--------------------------------------------------------------------------------
      A_ID
----------
20-JUN-13
Oracle. How to format a table containing description coulmns into spool output?
1.0000E+13

20-JUN-13
Oracle. How to format a table containing description coulmns into spool output?
2.0000E+13

A_DATE
---------
A_VERY_LONG_STRING
--------------------------------------------------------------------------------
      A_ID
----------

20-JUN-13
Oracle. How to format a table containing description coulmns into spool output?
3.0000E+13




SQL> COLUMN a_very_long_string FORMAT A79
SQL> COLUMN a_id FORMAT 99999999999999;
SQL> SELECT * FROM sqlplus_tbl;

A_DATE    A_VERY_LONG_STRING                                                                         A_ID
--------- ------------------------------------------------------------------------------- ---------------
20-JUN-13 Oracle. How to format a table containing description coulmns into spool output?  10000000000000
20-JUN-13 Oracle. How to format a table containing description coulmns into spool output?  20000000000000
20-JUN-13 Oracle. How to format a table containing description coulmns into spool output?  30000000000000

ちょっとしたヘルプ: http://ss64.com/ora/syntax-sqlplus.html

Oracle: http://docs.oracle.com/cd/B19306_01/server.102/b14357/ch6.htm#i1081008 (SQL*Plus ユーザーズ ガイドおよびリファレンス)

于 2013-06-20T07:50:49.873 に答える