integer lastInsertId(
[string
$tableName = null], [string
$primaryKey = null]
)
|
|
Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column.
As a convention, on RDBMS brands that support sequences (e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence from the arguments and returns the last id generated by that sequence. On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method returns the last value generated for such a column, and the table name argument is disregarded.
The IDENTITY_VAL_LOCAL() function gives the last generated identity value in the current process, even if it was for a GENERATED column.
Parameters:
string |
$tableName: |
OPTIONAL |
string |
$primaryKey: |
OPTIONAL |
API Tags:
Information Tags:
Throws: | Doctrine_Adapter_Db2_Exception |
Redefinition of:
- Doctrine_Sequence::lastInsertId()
- Returns the autoincrement ID if supported or $id or fetches the current ID in a sequence called: $table.(empty($field) ? '' : '_'.$field)
integer lastSequenceId(
string
$sequenceName
)
|
|
Return the most recent value from the specified sequence in the database.
This is supported only on RDBMS brands that support sequences (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null.
Parameters:
API Tags:
Information Tags:
Throws: | Doctrine_Adapter_Db2_Exception |
integer nextSequenceId(
string
$sequenceName
)
|
|
Generate a new value from the specified sequence in the database, and return it.
This is supported only on RDBMS brands that support sequences (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null.
Parameters:
API Tags:
Information Tags:
Throws: | Doctrine_Adapter_Db2_Exception |