===========================================================
===========================================================
也许你还不知道 - sqlplus的小秘密(1)
作者: oldwain(http://oldwain.itpub.net)发表于: 2005.09.05 15:09
分类: Oracle
出处: http://oldwain.itpub.net/post/6/40158
---------------------------------------------------------------
有没有为了dbms_output.put_line会"吃掉"最前面的空格而苦恼?
scott@O9I.US.ORACLE.COM> set serveroutput on
scott@O9I.US.ORACLE.COM> exec dbms_output.put_line(' abc');
abc
PL/SQL procedure successfully completed.(俺以前曾经很苦恼为了保留空格, 尝试了加".", 加不可见字符等办法, 不过终究觉得不自然)
实际上, 只要在set serveroutput on后加上format wrapped参数, 就可以避免这个问题
scott@O9I.US.ORACLE.COM> set serveroutput on format wrapped
scott@O9I.US.ORACLE.COM> exec dbms_output.put_line(' abc');
abc
PL/SQL procedure successfully completed.(需要引用, 请注明出处: http://oldwain.itpub.net)




