2012-04-03 55 views
4

是否有人知道是否有与甲骨文一起预处理器ç/C++,让我写ç或C++代码类似于:是否有比Pro * C/C++更智能的Oracle预处理器?

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_nameusers.ownerusers.tablespace_name)的定义类似于PL/SQL for loop statement

  • 自动获取直到完成机制(没有明确地调用stmt.fetch()程序或东西)在编译时和

  • 一个sql语句的correctnes的验证。

有没有这样的事情?

回答

1

根据以下9,10,11页,除PRO * C/C++外,没有其他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) 

向汤姆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++列在上面的页面上)。

+0

有可能是第三方工具,但我找不到任何,并与第三方的工具,你总是运行第三方工具不完全支持ORACLE特定SQL结构风险 - 出现了如此多的新的语法变化/增加PLSQL,尤其是10/11 – 2012-04-13 17:07:31