Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Dbi: proposal #1
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Dbi: proposal #1

When I implemented a DBI interface for pthrlib, I added a "serial"
method. This is an extension to the basic Perl DBI, but very useful.
Example (in pseudocode):

Table: create table employees (empid serial, name text, salary int);

let query = dbh#prepare "insert into employees (name) values ('John Smith')";;
let empid = query#serial ("employees_empid_seq");;     (* returns, eg., 1 *)

The argument to serial is the sequence name, required for PostgreSQL,
but can be ignored on other databases.


Richard Jones, Red Hat Inc. (London) and Merjis Ltd. Freshmeat projects:
MAKE+ is a sane replacement for GNU autoconf/automake. One script compiles,
RPMs, pkgs etc. Linux, BSD, Solaris.

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: