什么是pro * c? [英] What is pro *c?

查看:145
本文介绍了什么是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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆