Can I do better than this query?
select func_returns_str('key1') ||
nvl2( func_returns_str('key2'),
',' || func_returns_str('key2'),
null)
from dual;
I would like to avoid calling func_returns_str('key2') twice.
func_returns_str returns a varchar.
Elaborating further:
func_returns_str could be a generic function like substr() in Oracle which you can't change the definition.