Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is pro *c?

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

like image 413
suvitha Avatar asked Jan 25 '11 12:01

suvitha


1 Answers

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.

like image 147
paxdiablo Avatar answered Oct 25 '22 16:10

paxdiablo