oracle 什么是专业*c?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4793705/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 22:32:44  来源:igfitidea点击:

What is pro *c?

coracleoracle-pro-c

提问by suvitha

How is that useful? How can we access data from the database?

这有什么用?我们如何从数据库中访问数据?

回答by paxdiablo

Pro*C is actually a pre-compiler for Oracle database access within C code.

Pro*C 实际上是一个用于在 C 代码中访问 Oracle 数据库的预编译器。

You write your code with statements like:

您使用以下语句编写代码:

int sal;
EXEC SQL SELECT salary INTO :sal FROM employees WHERE name = 'Diablo, Pax';
if (sal < 100000)
    printf ("I'm not being paid enough!\n");

intermixing regular C with Pro*C statements (as you can see) and then you run it through the Pro*C compiler.

将常规 C 与 Pro*C 语句混合(如您所见),然后通过 Pro*C 编译器运行它。

What comes out of that is a C program which has the Pro*C statements replaced with the equivalent function calls which will do the same thing.

结果是一个 C 程序,其中 Pro*C 语句被替换为等效的函数调用,这些函数调用将执行相同的操作。

You then run this through a real C compiler and it gives you the executables to be run to perform whatever tasks you want.

然后您通过一个真正的 C 编译器运行它,它为您提供要运行的可执行文件以执行您想要的任何任务。

回答by Raj More

Pro C is Oracle's embedded SQL environment for use within C and C++

Pro C 是 Oracle 的嵌入式 SQL 环境,可在 C 和 C++ 中使用

http://infolab.stanford.edu/~ullman/fcdb/oracle/or-proc.html

http://infolab.stanford.edu/~ullman/fcdb/oracle/or-proc.html

回答by unwind

This web pageintroduces the Proc *C language. It seems to be a dialect of C that makes SQL database access easier. Here's a snippet:

本网页介绍了 Proc *C 语言。它似乎是 C 的一种方言,使 SQL 数据库访问更容易。这是一个片段:

int main() {
    int x; char *y; int z;
    /* ... */
    EXEC SQL INSERT INTO emp(empno, ename, deptno)
        VALUES(:x, :y, :z);