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 "c:\pathtooralibs\oracle.h"
struct DataRow
{
int id;
char name[16] ;
char junk[32] ;
} TheData ;
char szSID[] = "THEDBSID" ;
char szUID[] = "THEUSER" ;
char szPWD[] = "THEPWD" ;
char szMyQuery[] = "select something from somwhere" ;
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( "ID: %i\nNAME: %s\nJUNK: %s\n\n" TheData.id, TheData.name, TheData.junk ) ;
}
ora_disconnect( oraCONN ) ;
}
#include <stdio.h>
#include "c:\pathtooralibs\oracle.h"
struct DataRow
{
int id;
char name[16] ;
char junk[32] ;
} TheData ;
char szSID[] = "THEDBSID" ;
char szUID[] = "THEUSER" ;
char szPWD[] = "THEPWD" ;
char szMyQuery[] = "select something from somwhere" ;
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( "ID: %i\nNAME: %s\nJUNK: %s\n\n" TheData.id, TheData.name, TheData.junk ) ;
}
ora_disconnect( oraCONN ) ;
}