Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to run Oracle SQL statement in C program?

Status
Not open for further replies.

suhaimi

Technical User
Aug 3, 2001
71
US
Hi all,
I would like to read each record from a ORACLE database using SQL and output each of the records into different output files. How do I do this in C program???

Thanks in advance,
Suhaimi
 
You need to use Oracle ProC which comes with Oracle (well, it does with ours, but I don't do the purchasing!) Oracle ProC is a massive product which allows full integration of Oracle a 'C' and is far too detailed to be dealt with here.

Alternatively....
You could use system calls to run SQL in a shell. This leaves the problem of accessing the output of the commands. See a recent thread about running DOS commands within 'C' for more on this.
 
You could also use ORACLE's OCI (Oracle's Call Interface). This is an API into Oracle. This library provides a set of routines to execute SQL Statements and retrive the result sets. The ProC pre-processor generates calls to these routines.

This library is provided with Oracle.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top