caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Serge Aleynikov <serge@hq.idt.net>
To: caml-list@inria.fr
Subject: Oracle OCCI C++ interface
Date: Mon, 06 Nov 2006 13:18:07 -0500	[thread overview]
Message-ID: <454F7C5F.7030500@hq.idt.net> (raw)

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



             reply	other threads:[~2006-11-06 18:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-06 18:18 Serge Aleynikov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-11-02 21:53 Serge Aleynikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=454F7C5F.7030500@hq.idt.net \
    --to=serge@hq.idt.net \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).