irm-1.6-b3/MDB/ibase.php
/**
     * returns the next free id of a sequence
     *
     * @param string  $seq_name name of the sequence
     * @param boolean $ondemand when TRUE the seqence is
     *                          automatic created, if it
     *                          not exists
     * @return mixed MDB_Error or id
     * @access public
     */
returns the next free id of a sequence
@param string  $seq_name name of the sequence
@param boolean $ondemand when TRUE the seqence is
automatic created, if it
not exists
@return mixed MDB_Error or id
@access public
returns the next free id of a sequence @param string $seq_name name of the sequence @param boolean $ondemand when TRUE the seqence is automatic created if it not exists @return mixed MDB_Error or id @access public
function nextId($seq_name, $ondemand = true)
    {
        if (MDB::isError($connect = $this->connect())) {
            return $connect;
        }
        $sequence_name = strtoupper($this->getSequenceName($seq_name));
        $this->expectError(MDB_ERROR_NOSUCHTABLE);
        $query = "SELECT GEN_ID($sequence_name, 1) as the_value FROM RDB\$DATABASE";
        $result = $this->_doQuery($query);
        $this->popExpect();
        if ($ondemand && MDB::isError($result)) {
            $result = $this->createSequence($seq_name, 1);
            if (MDB::isError($result)) {
                return $result;
            }
            return $this->nextId($seq_name, false);
        }
        return $this->fetchOne($result);
    }
function nextId ( $ seq_name , $ ondemand = true ) { if ( MDB :: isError ( $ connect = $ this -> connect ( ) ) ) { return $ connect ; } $ sequence_name = strtoupper ( $ this -> getSequenceName ( $ seq_name ) ) ; $ this -> expectError ( MDB_ERROR_NOSUCHTABLE ) ; $ query = " SELECT GEN_ID( $ sequence_name , 1) as the_value FROM RDB \$ DATABASE " ; $ result = $ this -> _doQuery ( $ query ) ; $ this -> popExpect ( ) ; if ( $ ondemand && MDB :: isError ( $ result ) ) { $ result = $ this -> createSequence ( $ seq_name , 1 ) ; if ( MDB :: isError ( $ result ) ) { return $ result ; } return $ this -> nextId ( $ seq_name , false ) ; } return $ this -> fetchOne ( $ result ) ; }
returns the next free id of a sequence
 @param string  $seq_name name of the sequence
 @param boolean $ondemand when TRUE the seqence is
                          automatic created, if it
                          not exists
 @return mixed MDB_Error or id
 @access public
returns the next free id of a sequence @param string $seq_name name of the sequence @param boolean $ondemand when TRUE the seqence is automatic created if it not exists @return mixed MDB_Error or id @access public
//$sequence_name = $this->getSequenceName($seq_name);