====== createSequence ======
~~NOTOC~~
== See Also ==
[[v5:database:feature_comparison|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 [[v5:reference:genid|genId()]].
----------------------------------------
===== Usage =====
/*
* Connection assumed
*/
/*
* Create a sequence called my_sequence, using default start of 1
*/
$db->createSequence('my_sequence');