[Caml-list] Oracle OCCI C++ interface

Skip to first unread message

Serge Aleynikov

Nov 6, 2006, 1:22:02 PM11/6/06
to caml...@inria.fr
Hi All,

I would like to announce availability of the OCaml client interface
library for Oracle. In the contrast to existing projects (oci8ml,
eqoci) found elsewhere, this project uses Oracle 10g's OCCI C++
interface on top of OCI. This allowed to implement a rich set of DML
and DDL operations with the database. The library requires installation
of an Oracle 10g Instant Client library. See doc/index.html file for
installation instruction of prerequisites.

The following operations with an Oracle database are supported:

- Simple DML operations including SELECT / INSERT / UPDATE / DELETE
- Parameterized DML operations including SELECT / INSERT / UPDATE /
- Execution of PL/SQL stored procedures
- Execution of bulk DML array INSERT / DELETE / UPDATE operations
- Oracle exception handling
- Oracle bulk exception handling with specifying failed rows and
errors for each row
- Transaction control (commit and rollback)
- Automatic garbage control of Oracle resources (connections, statements
and cursors)
- Functional and Object-Oriented API included

You'll need to modify the Makefile to include paths to an Oracle home
and OCaml installation.

The OCaml portion of the library is written in the revised syntax. The
following example illustrates one of the most powerful features of using
array DML insert of records with exception-based control of failed rows
(note that the entire array is sent to an Oracle database in a single
network roundtrip):

let n = statement#execute_array
~sql:"insert into test (id, name, dt, num) values (:1,
:2, :3, :4)"
[| Var_int 1; Var_str "AAA"; Null_date; Null_float |];
[| Var_int 2; Null_str; Null_date; Null_float |];
[| Var_int 3; Null_str; Null_date; Null_float |]
Printf.printf "Inserted %d records using array DML\n" n
with [ORA_BULK_EXCEPTION (m, a) -> do {
print_endline m;
Array.iter (fun (i, e, m) -> Printf.printf " Row[%d]: %d -
%s\n" i e m) a

The project home page is http://oracaml.sourceforge.net. It contains
links to documentation and download site.

Your feedback and enhancement requests are welcome.



Serge Aleynikov
Routing R&D, IDT Telecom
Tel: +1 (973) 438-3436
Fax: +1 (973) 438-1464

Caml-list mailing list. Subscription management:
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply all
Reply to author
0 new messages