caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Oracle OCCI C++ interface
@ 2006-11-06 18:18 Serge Aleynikov
  0 siblings, 0 replies; 2+ messages in thread
From: Serge Aleynikov @ 2006-11-06 18:18 UTC (permalink / raw)
  To: caml-list

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 / 
DELETE
   - 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):

try
     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 |]
                 ]
     in
         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.

Regards,

Serge

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Oracle OCCI C++ interface
@ 2006-11-02 21:53 Serge Aleynikov
  0 siblings, 0 replies; 2+ messages in thread
From: Serge Aleynikov @ 2006-11-02 21:53 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 2293 bytes --]

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 / DELETE
  - 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):

try 
    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 |]
                ] 
    in
        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
      }
];

Your feedback and enhancement requests are welcome.

Regards,

Serge

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


[-- Attachment #2: occi-0.1.tar.gz --]
[-- Type: application/gzip, Size: 61709 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-11-06 18:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-06 18:18 Oracle OCCI C++ interface Serge Aleynikov
  -- strict thread matches above, loose matches on Subject: below --
2006-11-02 21:53 Serge Aleynikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).