[20201218]dbms_output.put_line無法輸出前面的空格.txt
[20201218]dbms_output.put_line無法輸出前面的空格.txt
--//昨天別人問的問題,自己測試看看。
1.環境:
SCOTT@book> @ ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
2.測試:
SCOTT@book> @ desc_proc sys dbms_output put_line
INPUT OWNER PACKAGE_NAME OBJECT_NAME
sample : @desc_proc sys dbms_stats gather_%_stats
OWNER PACKAGE_NAME OBJECT_NAME SEQUENCE ARGUMENT_NAME DATA_TYPE IN_OUT DEFAULTED
---------- -------------------- ------------------------------ ---------- -------------------- -------------------- --------- ----------
SYS DBMS_OUTPUT PUT_LINE 1 A VARCHAR2 IN N
SCOTT@book> set serveroutput on
SCOTT@book> exec dbms_output.put_line (' this is a test');
this is a test
PL/SQL procedure successfully completed.
--//感覺輸入引數做了處理。
SCOTT@book> exec dbms_output.put_line (chr(32)||chr(32)||' this is a test');
this is a test
PL/SQL procedure successfully completed.
--//^_^依舊。
3.上網檢索發現:
--//連結給出幾種解決方法:
SCOTT@book> set serveroutput on
SCOTT@book> show serveroutput
serveroutput ON SIZE UNLIMITED FORMAT WORD_WRAPPED
--//實際上預設是WORD_WRAPPED。
SCOTT@book> exec dbms_output.put_line(lpad('this', 8, ' ')||' is a test');
this is a test
PL/SQL procedure successfully completed.
--//這樣跟我前面測試一樣不行。
SCOTT@book> SET SERVEROUTPUT ON FORMAT WRAPPED
SCOTT@book> exec dbms_output.put_line (chr(32)||chr(32)||' this is a test');
this is a test
PL/SQL procedure successfully completed.
SCOTT@book> SET SERVEROUTPUT ON FORMAT TRUNCATED
SCOTT@book> exec dbms_output.put_line (chr(32)||chr(32)||' this is a test');
this is a test
PL/SQL procedure successfully completed.
--//最後,注意完成要選擇關閉,不要顯示檢視執行計劃出現問題。
SCOTT@book> set serveroutput on
SCOTT@book> select * from dept where rownum=1;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
SCOTT@book> @ dpc '' ''
PLAN_TABLE_OUTPUT
-------------------------------------------------------------------------------------
SQL_ID 9babjv8yq8ru3, child number 0
BEGIN DBMS_OUTPUT.GET_LINES(:LINES, :NUMLINES); END;
NOTE: cannot fetch plan for SQL_ID: 9babjv8yq8ru3, CHILD_NUMBER: 0
Please verify value of SQL_ID and CHILD_NUMBER;
It could also be that the plan is no longer in cursor cache (check v$sql_plan)
8 rows selected.
SCOTT@book> set serveroutput off
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2743228/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20241112]無法理解sqlplus的輸出.txtSQL
- PbootCMS模板如何輸出當前頁面的完整URL地址boot
- [20201218]快速替代查詢dba_extents.txt
- [20201218]資料檔案OS頭的修復.txt
- [20190524]sqlplus 與輸出&.txtSQL
- Pycharm複製程式碼時括弧前出現空格PyCharm
- [20201106]11g查詢DBA_TAB_MODIFICATIONS無輸出.txt
- [20220822]奇怪的ashtop輸出.txt
- [20211111]奇怪的ashtop輸出.txt
- [20210924]awk奇怪的輸出.txt
- [20191119]探究ipcs命令輸出.txt
- [20200317]NULL與排序輸出.txtNull排序
- ThinkPHP裡無法輸出圖片 設定響應頭PHP
- [20210902]cut使用輸出問題.txt
- [20200306]expand格式化輸出.txt
- [20190720]sqlplus 與輸出& 2.txtSQL
- [20210301]延遲顯示輸出.txt
- [20210419]避免冗餘的輸出.txt
- [20231003]windows 2003無法啟動.txtWindows
- win10搜狗輸入法怎麼CTRL+空格切換英文Win10
- 輸入和輸出基礎語法
- [20231103]輸出倒數第2行.txt
- [20210924]awk奇怪的輸出2.txt
- [20191106]善用column格式化輸出.txt
- [20191119]探究ipcs命令輸出2.txt
- [20180312]iostat顯示輸出問題.txtiOS
- 輸出資訊法(Debug)
- HTML如何輸入多個空格HTML
- PHP 後臺處理 JSON_encode 引數有空格,JS 輸出變 空格 變 + (加號)問題PHPJSON
- 輸出空目錄(無法用length長度為0判斷)
- delphi清理txt檔案多餘的空格
- [20240320]空格與sqlpus的sql語句.txtSQL
- 雙拼輸入法,助你神速輸出中文
- 6-12 奇偶分離排序(關注輸出的空格處理)排序
- [20230405]奇怪的顯示輸出寬度.txt
- [20181010]v$rman_configuration沒有輸出.txt
- 輸出當前分支的最新commit IDMIT
- Linux Ubuntu 20.04 LTS 解決無法輸入中文 輸入法問題LinuxUbuntu