To put things short, you say that everything will work as expected
as long as the application doesn't use the PRAGMA_RESTRICT_REFERENCES at all.
That's certainly true and it would be a sufficient answer in many cases.
However, our application is still using PRAGMA_RESTRICT_REFERENCES in many places, including customer-specific code, in some cases written by our customers.
This leads to a different question:
Is there a fool-proof way to replace PRAGMA_RESTRICT_REFERENCES(..., WNDS, WNPS) with a newer syntax?
I think the answer is "no" here.
I mean, DETERMINISTIC is not the same (because it implies RNPS, RNDS in addition) and PARALLEL_ENABLE is a bit like (RNPS, RNDS) only.
Without the RESTRICT_REFERENCES, the purity condition checking for functions called from SQL or DML occurs at run-time, not at compile-time, AFAIK.
So, just removing the RESTRICT_REFERENCES from the code completely will certainly work, but it gives up a certain amount of safety for the developers, similar to removing keywords like
final
from Java or
const
from C++ or replacing static SQL with dynamic SQL).
April 22, 2017 - 1:49 am UTC
"Is there a fool-proof way to replace PRAGMA_RESTRICT_REFERENCES(..., WNDS, WNPS) with a newer syntax? I think the answer is "no" here. "
Correct.