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

Home -> Community -> Usenet -> c.d.o.server -> Re: function NOW() to return sysdate

Re: function NOW() to return sysdate

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 29 Oct 2003 05:46:47 -0800
Message-ID: <2687bb95.0310290546.411dfd92@posting.google.com>


Neil Zanella <nzanella_at_cs.mun.ca> wrote in message news:<Pine.LNX.4.44.0310290508540.14042-100000_at_garfield.cs.mun.ca>...
> Hello,
>
> I would like to write an Oracle function called NOW() for compatibility
> with PostgreSQL. I would like such a function to simply return sysdate.
> I would also like to set the date format to standard Unix 'date -I' AKA
> ISO 8601 format. Anyone know how these portability tasks could be
> accomplished?
>
> Thanks,
>
> Neil

That is a pretty simple task. Open the SQL manual and look at the Oracle provided date functions. In specific to_char, which can format dates and numbers just about any way you want.

UT1> select to_char(sysdate,'dd/mm/yyyy') as thedate from sys.dual;

THEDATE



29/10/2003

Then look up "Create or Replace Function"

HTH -- Mark D Powell -- Received on Wed Oct 29 2003 - 07:46:47 CST

Original text of this message

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