ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection:createsequence

This is an old revision of the document!


createSequence

See Also

Feature Comparison Matrix

Syntax
bool createSequence(
     optional string $sequenceName='adodbseq',
     optional int $startNumber
     )
     

Description

The function createSequence() creates an auto-incrementing number device. If the database supports it, it uses native sequence handling routines, otherwise it emulates the functionality using a table and an auto-incrementing numbers.

Once created, numbers can retrieved using genId().


Usage

/*
 * Connection assumed
 */
 
/*
 * Create a sequence called my_sequence, using default start of 1
 */
$db->createSequence('my_sequence');
v5/reference/connection/createsequence.1452646433.txt.gz · Last modified: 2017/04/21 11:36 (external edit)