i am usin cfquery to call a spx to insert and that insert has in the end as: select scope_identity(); which returns me the last inserted id, i am wondering how do i fetch it, its weird i can not get it
a
Adam Cameron
01/08/2023, 6:01 PM
You're not giving us much to go on here. Showing us the code instead of just describing it would be helpful...
r
Rodney
01/09/2023, 1:15 PM
Set the result attribute of cfquery to a variable name and then cdump that variable. What does that tell you? An insert should put a value in generatedKey. No need for
select scope_identity()
Note, it will only work with auto incrementing values, not UUIDs.
g
gsr
01/09/2023, 3:07 PM
managed to fix, it basically i am doing everything right but just messed up the return statement at the end, so i fixed it and i was getting the data back