i am usin cfquery to call a spx to insert and that...
# cfml-beginners
g
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
You're not giving us much to go on here. Showing us the code instead of just describing it would be helpful...
r
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
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
👍 1