Created
June 1, 2022 21:13
-
-
Save christophervigliotti/43f44057fa11a4fca7abddf01903d3b9 to your computer and use it in GitHub Desktop.
ColdFusion => Get ID of inserted record when using cfscript.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
// given | |
var queryObject = new Query( | |
name = "resultsQuery", | |
sql = " | |
INSERT | |
INTO … | |
" | |
); | |
// Execute the query first using | |
result = queryObject.execute(); | |
// and then get the generated key | |
generated_key = result.getPrefix().generatedKey; | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment