OCI Sample code in C++/C

OCI Sample code in C++/C

Post by Normal M » Thu, 07 Mar 2002 16:21:21



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.
 
 
 

OCI Sample code in C++/C

Post by RKG » Fri, 08 Mar 2002 06:13:50


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.


Quote:> 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.


 
 
 

OCI Sample code in C++/C

Post by Avi Abram » Fri, 08 Mar 2002 13:50:34



> 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.

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

http://technet.oracle.com

Good Luck,
Avi.

 
 
 

OCI Sample code in C++/C

Post by Alexei Polkhano » Sat, 09 Mar 2002 04:03:26


    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.


Quote:> 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.

 
 
 

OCI Sample code in C++/C

Post by Markus Schuman » Wed, 13 Mar 2002 00:30:29


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;

Quote:}

 return 1;

Quote:}

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.


Quote:> 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.

 
 
 

1. C++ or C sample for OCI wanted

I started programming with C++ with OCI (on Windows NT and VC++ 5.0)
and I fight with the DATE type. I am not able to store  data  with the
obndnr C-function with the DATE type.

Does anybody have an idea or an example ?
And/Or does anybody have already developed a C++ Class Library which
can be used under VC++ 5.0 from Microsoft ?

Uwe

2. OLAP Presntation

3. Redback - a transactional web development tool

4. OCI Array Fetch Sample Code.

5. progress...

6. Oracle8 OCI -- sample code?

7. Problems doing insert with a cursor

8. Compiling OCI C++ code on HPUX 11

9. Sample Code: ODBC C++ Library

10. Sample ADO/OLE-DB code in C++

11. OLEDB SQL SERVER C++ sample code

12. Sample code using XWindows (and maybe even C++)