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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

c and oracle

Status
Not open for further replies.

cDevX99

Programmer
Aug 29, 2001
39
US
I want to write a program that will connect to, read from and update an oracle 9i database. The functionality i need to create is something along the following lines of seudo code. I need to know what libs I need, where to get them, and the basics of how to use them. If anyone can point me in the right direction, i would appreciate it!

#include <stdio.h>
#include &quot;c:\pathtooralibs\oracle.h&quot;

struct DataRow
{
int id;
char name[16] ;
char junk[32] ;
} TheData ;

char szSID[] = &quot;THEDBSID&quot; ;
char szUID[] = &quot;THEUSER&quot; ;
char szPWD[] = &quot;THEPWD&quot; ;
char szMyQuery[] = &quot;select something from somwhere&quot; ;
ora_connection_var * oraCONN ;
ora_row_var * oraROW

int main( int argc, char * argv[] )
{
oraCONN = ora_connect( szSID, szUID, szPWD ) ;
ora_query( &oraCONN, szMyQuery ) ;
while( oraROW = ora_get_next_row( oraCONN ) )
{
parse_rec( oraROW, TheData );
printf( &quot;ID: %i\nNAME: %s\nJUNK: %s\n\n&quot; TheData.id, TheData.name, TheData.junk ) ;
}

ora_disconnect( oraCONN ) ;
}
 
BTW, I am using the Microsoft Visual C++ compiler.
 
Ok, found the libs headers and such ( part of the oracle server installation ) even found a bunch of samples, but there doesn't seem to be any kind of docs on how to use these libs. I am figuring it out based on the samples, but it would be quicker if I had some basic documentation. Does this exist somewhere, perhaps online?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top