A reader, October 13, 2016 - 10:12 am UTC
Too bad that this method is not correct. I tried to avoid code duplication - request, decorated in a parameterized representation in a real application is not small (over 250 lines).
As a result, I need:
Either create another view. its code will be completely the same, only different is the name of a function that returns the value.
Or write a new select statement, about 500 lines, combining two very similar query, each of which does the same thing but for different values of parameters.
In any case, thank you very much for your reply
October 13, 2016 - 2:44 pm UTC
Yes, you should look into another method. As Mike says below, just because it looks like Oracle will call the functions in a certain order, doesn't mean it will!
Don't depend on order of evaluation
Mike Tefft, October 13, 2016 - 11:27 am UTC
Your method seems to depend on set_date being executed before get_date.
There are very few cases in SQL where you can depend on order of execution - a CASE statement is the only example that comes to mind at the moment.
So I think the entire approach is based on an unwarranted assumption.
October 13, 2016 - 2:44 pm UTC
Great point.