
SPOOLコマンドで下記のとおりNULLを出力すると
aaa, ,bbb
となり、NULLが半角スペースになっています。
私が理想としている出力は
aaa,,bbb
というような、NULLが0バイトの文字になってほしいのですが、どうしたら可能でしょうか?
■補足
select 'aaa' || ',' || ',' || 'bbb' from dual;
というようなやり方もあるみたいですが、これ以外に方法はありますか?
[vagrant@ ~]$ sqlplus usr01/usr01@XE SQL*Plus: Release 11.2.0.2.0 Production on Mon Jun 25 11:47:01 2018 Copyright (c) 1982, 2011, Oracle. All rights reserved. ERROR: ORA-28002: the password will expire within 7 days Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production SQL> set head off SQL> set pages 0 SQL> set lines 100 SQL> set echo off SQL> set colsep ',' SQL> show NULL null "" SQL> spool out.txt SQL> select 'aaa', NULL, 'bbb' from dual; aaa, ,bbb SQL> exit Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production [vagrant@ ~]$ cat out.txt SQL> select 'aaa', NULL, 'bbb' from dual; aaa, ,bbb SQL> exit [vagrant@ ~]$


回答2件
あなたの回答
tips
プレビュー