I have a query that makes several calls within a SELECT statement to a user-defined function. The function (vfget) returns the value back from key=value pairs contained within a string.
Is it possible for the query to just call the function once and store this in a variable so that it can be reused within the same query?
Currently my query is:
SELECT
CASE WHEN(right(vfget(appmod_params, 'service'), 3) = '_dd' OR right(vfget(appmod_params, 'service'), 3) = '_wp')
THEN left(vfget(appmod_params, 'service'), length(vfget(appmod_params, 'service'))-3)
ELSE vfget(appmod_params, 'service')
END
FROM ota1003
LIMIT 10