Jun 26 2018
10:19 AM
- last edited on
Apr 07 2022
05:12 PM
by
TechCommunityAP
Jun 26 2018
10:19 AM
- last edited on
Apr 07 2022
05:12 PM
by
TechCommunityAP
Hi,
I would like to create a stored function that has input parameters. Is there a way I can do this?
Right now I have:
// --- Start of stored function ------
// --- End of stored function ------
But when trying to call DiffUsers(vmid, ts1, ts2) outside of the stored function I get an error.
Jun 27 2018 08:12 PM
You can use a let statement as in your example to serve the same purpose as a SProc. Today, however, this is only possible at query time; you cannot unfortunately save these as a "function" the same way that you can with views. It is something on our backlog, but will take a while to properly implement. For more details on the query-time options available, check out the article on UDFs.
Jan 17 2019 02:57 PM
Feb 25 2019 03:50 AM
Any idea when this feature will be lightened up?
we are looking forward to use saved function with parameters.
Thanks.