What is pro *c?

ⅰ亾dé卋堺 提交于 2019-12-01 03:44:00

问题


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


回答1:


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");

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

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.

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




回答2:


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

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




回答3:


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

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


来源:https://stackoverflow.com/questions/4793705/what-is-pro-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!