DB_common::createSequence()
DB_common::createSequence() -- Creates a new sequence
Synopsis
integer createSequence (string $seq_name)
Parameter
- string
$seq_name
name of the new sequence to
create
To avoid problems with various database systems,
sequence names should start with a letter and only
contain letters, numbers and the underscore character.
Throws
Table 39-1. Possible PEAR_Error values
| Error code | Error message | Reason | Solution |
|---|
| every error code | |
Database specific error
|
Check the name of the sequence. If correct,
probably a bug in the sequence implementation
|
Note
This function can not be called
statically.
| Warning |
When using PEAR DB's sequence methods, we strongly advise using
these methods for all procedures, including the creation of the
sequences. Do not use PEAR DB's methods to access
sequences that were created directly in the DBMS. See the warning
on the "Intro - Sequences" page
complete information.
|
Example
Example 39-1. Using createSequence()
<?php
// Once you have a valid DB object named $db...
$tmp = $db->createSequence('mySequence');
if (PEAR::isError($tmp)) {
die($tmp->getMessage());
}
?>
|
|