Subject R: [firebird-php] Re: drupal 7 and firebird it might work
Author u.masotti@libero.it
Hi Marius,
----Messaggio originale----
Something like this must be implemented
http://api.drupal.org/api/drupal/includes--database--pgsql--database.
inc/function/DatabaseConnection_pgsql%3A%3AnextId/7

AFAIU Postgres needs a lock to sequences that Firebird doesn't need.

Seems that code can be simplified a lot, and parameter $existing can be safely
ignored because in Firebird sequences are out of transaction scope.

Something like this:

<?php
// parameter is ignored as not needed for FB
public function nextId($existing = 0) {

// Retrive the name of the sequence. This information cannot be cached
// because the prefix may change, for example, like it does in simpletests.
// This must be implemented elsewhere
$sequence_name = $this->makeSequenceName('sequences', 'value');

// Firebird 2.5 has NEXT VALUE FOR syntax
$id = $this->query("SELECT NEXT VALUE FOR '" . $sequence_name . "' FROM
RDB$DATABASE")->fetchField();
return $id;
}
?>

HTH

Ciao.
Mimmo.