IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New It would surprise me if the SYSDATE wasn't in a closure
That is, it is much more efficient to grab the clock once at the start of the query and use that local variable in place of all SYSDATE's within the query.

All my oracle books are at work though, so I'm just doing a WAG.
New Brief testing says this might be correct.
select to_char(sysdate - sysdate, '.99999999999999') from dual; was 0 all the way out.

Also:
SQL> select cast(sysdate as timestamp),cast(sysdate as timestamp) from dual;\n\nCAST(SYSDATEASTIMESTAMP)\n---------------------------------------------------------------------------\nCAST(SYSDATEASTIMESTAMP)\n---------------------------------------------------------------------------\n05-AUG-04 12.00.51.000000 AM\n05-AUG-04 12.00.51.000000 AM


Not exactly a rigorous test, but...

I do believe that multiple calls to sysdate in a pl/sql function will return different values, however. It's certainly a performance drag.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New FWIW
SQL 2000 doesn't allow you to call GETDATE() from within functions for that reason (which can be a real PITA when that's what you actually need to do).

I'd assume that functions are sequential, not atomic, in nature, so you would be faced with SYSDATE varying through a function called within a query.
     risky use of Oracle SYSDATE? - (tablizer) - (11)
         Hmm. Order of evaluation - (broomberg)
         If only the date matters... - (admin) - (5)
             Still could cross over -NT - (broomberg) - (4)
                 Unless you change the logic - (admin) - (3)
                     sysdate wrapper - nice touch - (broomberg) - (1)
                         Guideline doc for DML wrappers: - (admin)
                     Re: Unless you change the logic - (tablizer)
         Another thought - (admin)
         It would surprise me if the SYSDATE wasn't in a closure - (ChrisR) - (2)
             Brief testing says this might be correct. - (admin) - (1)
                 FWIW - (ChrisR)

Happy happy joy joy!
74 ms