【问题标题】:disabling c++ output message for sql loader禁用 sql loader 的 C++ 输出消息
【发布时间】:2013-03-14 09:27:05
【问题描述】:

我有一个 C++ 代码,我在其中使用system() 使用 sql 加载器。当 SQL Loader 在运行代码时执行时,我收到了下面提到的要禁用的消息:

SQL*Loader: Release 10.2.0.1.0 - Production on Thu Mar 14 14:11:25 2013

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

Commit point reached - logical record count 20
Commit point reached - logical record count 40
Commit point reached - logical record count 60
Commit point reached - logical record count 80

【问题讨论】:

    标签: c++ linux g++ sql-loader


    【解决方案1】:

    记住system 函数使用shell 来执行命令。所以你可以使用普通的shell重定向:

    system("/some/program > /dev/null");
    

    【讨论】:

      【解决方案2】:

      您可以使用silent=ALL 选项来隐藏这些消息:

      system("/orahomepath/bin/sqlldr silent=ALL ...")
      

      另见SQL*Loader Command-Line Reference

      当 SQL*Loader 执行时,您还会在屏幕上看到反馈消息,例如:

      已达到提交点 - 逻辑记录数 20

      您可以通过使用一个或多个值指定 SILENT 来抑制这些消息:

      • ...
      • ALL - 实现所有抑制值:HEADER、FEEDBACK、ERRORS、DISCARDS 和 PARTITIONS。

      根据 sql*ldr 实现,您可能仍然会得到一个或另一个输出 - 如果您需要完全静音,请参阅下面@Joachim 的答案。

      【讨论】:

      • 请注意,SILENT=ALL 也会将该过滤器应用于日志文件,而不仅仅是您在终端屏幕上看到的内容
      猜你喜欢
      • 2014-11-26
      • 1970-01-01
      • 2017-12-04
      • 2011-12-01
      • 2015-09-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-19
      相关资源
      最近更新 更多