From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 25499BC68 for ; Mon, 6 Nov 2006 19:18:09 +0100 (CET) Received: from mail.corp.idt.net (mail.corp.idt.net [169.132.25.53]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id kA6II8Xg007810 for ; Mon, 6 Nov 2006 19:18:08 +0100 Received: from [169.132.9.113] (account saleyn HELO [169.132.9.113]) by mail.corp.idt.net (CommuniGate Pro SMTP 4.2.10) with ESMTP id 184537511 for caml-list@inria.fr; Mon, 06 Nov 2006 13:18:07 -0500 Message-ID: <454F7C5F.7030500@hq.idt.net> Date: Mon, 06 Nov 2006 13:18:07 -0500 From: Serge Aleynikov User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: caml-list@inria.fr Subject: Oracle OCCI C++ interface Content-Type: text/plain; charset=windows-1251; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 454F7C60.003 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 makefile:01 ocaml:01 syntax:01 printf:01 printf:01 endline:01 iter:01 sourceforge:01 garbage:01 exception:01 exception:01 api:01 int:01 int:01 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