Om du ställer in resultatattributet i cfquery
taggen primärnyckeln returneras utan extra SQL
<cfquery datasource="x" result="resultName">
INSERT INTO...
</cfquery>
<cfset newID = resultName.IDENTITYCOL />
- MSSQL:
IDENTITYCOL
- Oracle:
ROWID
- Sybas:
SYB_IDENTITY
- Informix:
SERIAL_COL
- Mysql:
GENERATED_KEY