Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Date function that leaves only the time?

Re: Date function that leaves only the time?

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Wed, 17 Dec 2003 14:58:15 -0800
Message-ID: <1071701803.824252@yasure>


Norman Dunbar wrote:

> Daniel Morgan <damorgan_at_x.washington.edu> wrote in message
> news:<1070914016.474622_at_yasure>...
>
>

>>This brings up an interesting question. If I perform the following
>>query:
>>
>>  SQL> select argument_name, data_type
>>   2  from all_arguments
>>   3  where object_name = 'TO_TIME';
>>

>
> <SNIP>
>
>>I get something that seems to be undocumented at tahiti.oracle.com.
>>
>>Does anyone have an example of using this?
>>
>>Thanks.

>
>
> Daniel,
>
> it seems to be part of SYS.STANDARD and turns up if you desc
> sys.standard. However, calling it results in the following, even if
> connected as SYS :
>
> SQL> select sys.standard.to_time(sysdate) from dual;
> select sys.standard.to_time(sysdate) from dual
> *
> ERROR at line 1:
> ORA-06552: PL/SQL: Statement ignored
> ORA-06553: PLS-302: component 'TO_TIME' must be declared
>
>
> SQL> select sys.standard.to_char(sysdate) from dual;
>
> SYS.STANDARD.TO_CHAR(SYSDATE)
> --------------------------------------------------------------------------------
> 17-DEC-03
>
>
> Still, it looks interesting ........
>
> On the other hand, maybe it is an internal use only helper function
> for the TO_TIMEZONE function ?
>
>
> Cheers,
> Norm.

I did exactly what you did and got the same result. What is strange is that anything in a package exposed to the outside world is in the package header. So I went to \rdbms\admin and found stdspec.sql which contains the function's header:

function TO_TIME (RIGHT varchar2 character set any_cs) return time_unconstrained;

     pragma BUILTIN('TO_TIME', 0, 15, 1);
     function TO_TIMESTAMP (RIGHT varchar2 character set any_cs)
                            return TIMESTAMP_UNCONSTRAINED;
     pragma BUILTIN('TO_TIMESTAMP', 0, 15, 3);


And, while visible, doesn't seem to be usable outside the package. So fir the first time I am looking at the datatypes TIME_UNCONSTRAINED and TIMESTAMP_CONSTRAINED and the PRAGMA builtin.

I'm hoping I can learn from someone that has torn this apart and figured out what is going on here.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Wed Dec 17 2003 - 16:58:15 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US