【问题标题】:File input for select statement in shell sciptshell脚本中select语句的文件输入
【发布时间】:2017-03-25 06:33:30
【问题描述】:

我有一个包含 select 语句输入的文本文件。

sqlplus -s $USERNAME/$PASSWORD@$HOST<< EOF
spool $DIRECTORY/UPDATE.xls
select acc,cr,dr from count where acc in $DIRECTORY/acc.txt;
spool off;
exit
EOF

请告诉我如何在突出显示的部分使用文本文件作为输入。

【问题讨论】:

    标签: sql shell unix


    【解决方案1】:

    您可以结合cat 命令使用背部抽动。所以

    select acc,cr,dr from count where acc in `cat $DIRECTORY/acc.txt`;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-15
      • 2013-03-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-25
      • 2013-03-13
      相关资源
      最近更新 更多