Bruce Momjian wrote:
> It is not clear to me; is this its own transaction or a function call?
>
That looks like an anonymous PL/SQL procedure to me. Another
question might be, given:
"more than one reference to one or more <datetime value
function>s, then all such references are effectively evaluated
simultaneously"
under what conditions does Oracle report *the same* value for
CURRENT_TIMESTAMP? So far, in this discussion, we have the
following scenarios:
1. RDBMS start: No one
2. Session start: No one
3. Transaction start: PostgreSQL
4. Statement start: ???
5. CURRENT_TIMESTAMP evaluation: Oracle 9, ???
Given what Tom has posted regarding the standard, I think Oracle
is wrong. I'm wondering how the others handle multiple
references in CURRENT_TIMESTAMP in a single stored
procedure/function invocation. It seems to me that the lower
bound is #4, not #5, and the upper bound is implementation
dependent. Therefore PostgreSQL is in compliance, but its
compliance is not very popular.
Mike Mascari
mascarm@mascari.com
> Dan Langille wrote:
>>
>>
>>DECLARE
>> time1 TIMESTAMP;
>> time2 TIMESTAMP;
>> sleeptime NUMBER;
>>BEGIN
>> sleeptime := 5;
>> SELECT CURRENT_TIMESTAMP INTO time1 FROM DUAL;
>> DBMS_LOCK.SLEEP(sleeptime);
>> SELECT CURRENT_TIMESTAMP INTO time2 FROM DUAL;
>> DBMS_OUTPUT.PUT_LINE(TO_CHAR(time1));
>> DBMS_OUTPUT.PUT_LINE(TO_CHAR(time2));
>>END;
>>/
>>30-SEP-02 11.54.09.583576 AM
>>30-SEP-02 11.54.14.708333 AM
>>
>>PL/SQL procedure successfully completed.