2016-11-02 14 views
0

出力データは表示されません私は(Macクライアントを経由してリモートで)実行します。のSQLPLUS配管 -

echo "select table_name from user_tables" | sqlplus 'myuser/[email protected]:myport/mysid' 

私が表示はデータを取得していない:

SQL*Plus: Release 12.1.0.2.0 Production on Wed Nov 2 15:12:57 2016 

Copyright (c) 1982, 2016, Oracle. All rights reserved. 


Connected to: 
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production 
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, 
Data Mining and Real Application Testing options 

SQL> 2 Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production 
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, 
Data Mining and Real Application Testing options 

しかし、私は、私はそれを実行したときので、それが動作します知っています対話モード(すなわち無配管)に私は戻ってデータを取得します:

SQL> select count(*) from user_tables; 

    COUNT(*) 
---------- 
     353 

を私はので、私はそれがとても表示するように期待していたlogin.sqlを持っていませんたとえそれが醜いものであっても、

私は間違っていますか?

答えて

0

私が疑うように、それは小さな問題です。あなたは書式設定オプションを追加したい場合は

echo "select table_name from user_tables;" | sqlplus 'myuser/[email protected]:myport/mysid' 

は、あなたが対話的に逐語的にどうなるかの操作を行います:

echo "set pages 200\n select table_name from user_tables;" | sqlplus 'op_qa_zact/[email protected]:1520/QADB01' 
セミコロンを含む - あなたは通訳を入力します正確に何をエミュレートしなければならないことを忘れないでください