Good question. A good strategy is to move away from stored procedures in favour of something like this:
But if you must, there are several usages:
- Using as field
- Getting data from stored procedure (as query)
- Using through temporary table
- Crafting manual queries
I’ll find the corresponding documentation for the above cases and will post below, but in the meantime, if you have any other use-cases you would like me to document - please let me know by replying.