Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OCI Sample code in C++/C

512 views
Skip to first unread message

Normal Man

unread,
Mar 6, 2002, 2:21:21 AM3/6/02
to
I'm trying to write an application in C++ which would connect to a
Oracle 8i, perform SELECTS and UPDATES. Does anyone have a sample code
which would enable me to do this. Any pointers would be appreciated
too.

RKG

unread,
Mar 6, 2002, 4:13:50 PM3/6/02
to
go to otn.oracle.com click on documentation then on 9i database. there is a
manual there on OCI. I think there are samples there.


"Normal Man" <coo...@yahoo.com> wrote in message
news:bc9ee28b.02030...@posting.google.com...

Avi Abrami

unread,
Mar 6, 2002, 11:50:34 PM3/6/02
to

Hi Norman,
Have you searched Oracle's Technet site...

http://technet.oracle.com

Good Luck,
Avi.

Alexei Polkhanov

unread,
Mar 7, 2002, 2:03:26 PM3/7/02
to
I found examples provided in OCI Programmers Guide usually incorrect,
some functions for example have different number of parameters than used,
constants and macro not defined anywhere in OCI heders (like OCI_HTYPE_STMT
in headers OCI_HTYPE_STATEMENT in print :) )

I think you can find bunch of well written OCI applications at
http://sourceforge.net .just search for ORACLE. Look at Apache::OWA -
module for Apache mod perl as C example, for C++ there is a lots Open Sourse
class wrappers, some of them I believe you can use not only as examples.


"Normal Man" <coo...@yahoo.com> wrote in message
news:bc9ee28b.02030...@posting.google.com...

Markus Schumann

unread,
Mar 11, 2002, 10:30:29 AM3/11/02
to
Hello,

I have a little class ... that allows you to the following thing:

#include "../db_ora/db.h"

int main(int argc, char *argv[])
{
DBConnection db;

db.open("scott/tiger");

DBItr myIterator ( &db, "SELECT ename,job FROM emp");

while(myIterator.next())
{

cout << "name: " << myIterator[0] << endl;
cout << "name: " << myIterator["ename"] << endl;

cout << "job: " << myIterator[1] << endl;
cout << "job: " << myIterator["job"] << endl;
}

return 1;
}


The stuff is derived from
http://codeguru.earthweb.com/mfc_database/Osql10.shtml

If you need the stuff on windows use the above URL ... for UNIX just send me
an e-mail.


Markus.


"Normal Man" <coo...@yahoo.com> wrote in message
news:bc9ee28b.02030...@posting.google.com...

0 new messages