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: rfmdate equivalent?

Re: rfmdate equivalent?

From: <stevedhoward_at_gmail.com>
Date: 23 Jan 2006 06:02:23 -0800
Message-ID: <1138024943.468655.202200@o13g2000cwo.googlegroups.com>

Chrean wrote:
> Hi everybody,
> I'm working on the porting of a old Informix ESQL application to Oracle
> Pro*C.
> After some struggle against different issues, I'm stuck at rfmtdate
> function.
> Is there a Oracle function that could be used in place of Informix's
> rfmtdate? Something similar, thus not requiring the rewrite of a lot of
> source code?
> For those who know just Oracle, frmtdate proto is as follows:
>
> int rfmtdate(long jdate, char* fmtstring, char *outbuf)
>
> The 3 parameters are easily recognized as Informix's internal data
> representation (long), a format string ("dd/mm/yyyy" e.g.), and an
> output buffer for the resulting string.
> Is oracle representing date datatype as a long, just like Informix? Is
> it possible to convert this function?
>
> TIA,
> Chrean

Your function prototype looks like C, but if you are looking to do it in straight SQL, in Oracle just use the TO_CHAR function.

TO_CHAR(your_date_value,'YYYY/MM/DD')

Oracle stores a true DATE (there are other datatypes such as TIMESTAMP, depending on your Oracle version) in a seven byte internal format. See http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200.pdf for more info.

Regards,

Steve Received on Mon Jan 23 2006 - 08:02:23 CST

Original text of this message

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