什么是pro * c? [英] What is pro *c?
问题描述
这有什么用?我们如何从数据库访问数据?
How is that useful? How can we access data from the database?
推荐答案
Pro * C实际上是在C代码中进行Oracle数据库访问的预编译器.
Pro*C is actually a pre-compiler for Oracle database access within C code.
您使用如下语句编写代码:
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");
将常规C与Pro * C语句混合(如您所见),然后通过Pro * C编译器运行它.
intermixing regular C with Pro*C statements (as you can see) and then you run it through the Pro*C compiler.
产生的结果是一个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编译器运行此程序,它为您提供了可执行的可执行文件,以执行所需的任务.
You then run this through a real C compiler and it gives you the executables to be run to perform whatever tasks you want.
这篇关于什么是pro * c?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!