tags:

views:

326

answers:

2

Where is the function sysdate stored, and in what package, e.g:

select sysdate from dual;
select systimestamp from dual;

Also, take this query:

select sys.login_user,sys.database_name ,sys.sysevent from dual;
  • what is sys here?
  • Is it a package?
  • where is this package stored?
  • can I view the source(text) in this package please provide me the query?
+1  A: 

sys is a schema. sysdate is a glovbally available variable containing the current date/time.

Visage
+.5 for sys, -.5 for saying sysdate is a variable
+2  A: 

SYSDATE and SYSTIMESTAMP are functions in the STANDARD package owned by SYS. However, this is a special package and so you don't need to specify standard.sysdate (in fact, you can't!)

You can view this package like this:

select text
from   all_source
where owner='SYS'
and name='STANDARD'
and type = 'PACKAGE BODY'
order by line;
Tony Andrews