微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

是否有比Oracle * C/C++更智能的Oracle预处理器?

有人知道是否有与C一起使用C/C++的预处理器,这将允许我编写类似于以下内容的C或C代码

void populateTableList(GuiList* tableList) {

     for users in ( select table_name,owner,tablespace_name
                      from dba_tables) 
     {
         tableList -> addRow(
                         users.table_name,users.owner,users.tablespace_name);
     }
 }

我正在寻找的主要功能

>准自动声明/定义所选值(此处为:users.table_name,users.owner和users.tablespace_name),类似于PL / sql for循环语句和
>自动提取直到完成机制(没有明确地调用stmt.fetch()过程或其他)和
>在编译时验证sql语句的正确性.

有这样的事吗?

解决方法

根据以下9,10,11页,没有其他C/C++.
PRO * C/C++以外的“预编译器”.有一个C/C++编程
语言接口称为OCI / OCCI,但从技术上讲,这不是预编译器

页面指出“OCI程序未预编译”:

http://www.orafaq.com/wikI/Oracle_Call_Interfaces

这些页面列出了可用的C/C++编译器工具:

9I预编译页面
    http://docs.oracle.com/html/A97297_01/ch4_comp.htm

This page lists PRO*C/C++,and the Non C precompilers: PRO*COBOL,PRO*FORTRAN,sql for ADA,the OCI

10G预编译页面:参见部件号B25416-02
    (本页未列出任何其他C/C++预编译器
    已经列出)

9I到11个预编译器说明:
    https://blogs.oracle.com/db/entry/master_note_for_precompilers_oci_and_occi

(This page Does not list any other C/C++ precompilers not
already listed)

问Tom OCI / PRO * C比较:
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:999630650601

This page shows an example that has an sql statement with
invalid Syntax being passed to OCI,through OCIStmtPrepare()
and the compile does not error.  This means that 
at the time of the OCI compile a complete Syntax check
of the sql statement is not done which is 
consistent with what I have seen.

页面指出“OCI和预编译器支持(..)”暗示
OCI不进行预编译:

http://www.oracle.com/technetwork/database/features/oci/index.html

看起来你所拥有的代码中嵌入了sql.去检查这个代码在编译时的有效性需要预编译器有权访问数据字典(我知道PRO * C可以访问)你所拥有的语法不同于其他ORACLE上面列出的C/C++支持工具do).

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐