v5:reference:connection:insert_id
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
v5:reference:connection:insert_id [2018/06/11 10:16] – [Usage] function names starting with lowercase (#426) dregad | v5:reference:connection:insert_id [2019/07/08 22:20] – mnewnham | ||
---|---|---|---|
Line 14: | Line 14: | ||
It is important to remember that there is only a single storage instance for the number, and if one insert statement with an auto-increment number succeeds another, the insert_id value for the second statement will overwrite the value of the first, so retrieve the value of the first before executing the second. | It is important to remember that there is only a single storage instance for the number, and if one insert statement with an auto-increment number succeeds another, the insert_id value for the second statement will overwrite the value of the first, so retrieve the value of the first before executing the second. | ||
- | |||
- | ===== Postgresql / SAP MaxDB ===== | ||
- | |||
- | The only drivers that __require__ the optional '' | ||
===== Usage ===== | ===== Usage ===== | ||
Line 46: | Line 42: | ||
*/ | */ | ||
</ | </ | ||
+ | |||
+ | ===== Oracle Using Emulated Sequences ===== | ||
+ | If you use the emulated sequence function with the [[v5: | ||
+ | |||
+ | <code php> | ||
+ | |||
+ | /* | ||
+ | * Oracle Connection assumed | ||
+ | */ | ||
+ | $sequence = insertId(' | ||
+ | </ | ||
+ | |||
+ | For that reason, the usage rules about a single instance do not apply. However if you are writing cross-database code you should follow those rules. | ||
+ | |||
+ | ===== Postgresql / SAP MaxDB ===== | ||
+ | |||
+ | The only drivers that __require__ the optional '' | ||
+ | |||
+ |
v5/reference/connection/insert_id.txt · Last modified: 2023/06/20 09:40 by dregad