There are such calls
some_proc(sysdate, sysdate);
select some_func(sysdate, sysdate) from dual
I wonder if there are any possibility that two sysdate calls will give different values? Does sysdate not change only due to speed of execution?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
some_proc(sysdate, sysdate);– sysdate will NOT always be the same when used in a PL/SQL statementselect some_func(sysdate, sysdate) from dual;– sysdate will always be the same when used in a SQL statement (even if that SQL statement is calling PL/SQL)From the Statement-Level Read Consistency section of the Concepts guide: “Oracle always enforces statement-level read consistency. This guarantees that all the data returned by a single query comes from a single point in time—the time that the query began.”
That page kind of implies that the same is not true of a pure PL/SQL function.
We can demonstrate this by creating a large function (SQL context) and procedure (PL/SQL context) that accept many timestamp parameters, then compare the input parameters for any differences. I used timestamps instead of dates because they should work the same way with regards to consistency, but timestamp(9) is a billion times more likely to change than a date. (Roughly – there are probably lots of rounding and internal clock details I’m unaware of that make this more complicated.)