Implement returntype attribute for cfstoredproc/cfprocresult

Long story short I’d like to upvote this ticket from 8 years ago :slight_smile:
https://luceeserver.atlassian.net/browse/LDEV-1566

Even If only cfstoredproc, or cfprocresult perhaps would be more appropriate, could support the returntype attribute it would bring an immense performance gain to the system I’m working on.

I have code that reads around 2000 rows, into a query before then converting it into a struct of structs. Right now the code converts from a query and is taking approx 2 seconds using a helper written in CF, whereas using cfquery and returntype=“array” I can make the conversion in 0.1 seconds approx.

I’m aware I can work around this and have used cfquery and EXEC but… this would be the cleaner, intuitive and potentially more secure solution.

It kind of just feels like a logical bit of feature parity.

Jira returns the following when I try to upvote:
image

1 Like

something we can look into! can you create a ticket?

in the meantime, have you tried

1 Like

Ah. Let me correct my original post, I have a generic helper function that converts from a query to a struct of structs of structs. Rather than a struct of structs as I originally posted. So query.ToStruct() won’t help as I don’t have a singular primary key necessarily.

I’ve requested access to add a ticket.
I’ll try with my EXEC workaround for now. Thank you for your (quick) response!

query.ToStruct() is nice. I then looked for query.ToArray() which feels like a logical supplement.