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: Mark C. Stock <mcstockX_at_Xenquery>
Date: Mon, 23 Jan 2006 09:14:30 -0500
Message-ID: <mqCdnWPFfpdUeUneRVn-qw@comcast.com>

<stevedhoward_at_gmail.com> wrote in message news:1138024943.468655.202200_at_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
>

so, you likely will be able to write a wrapper function called rfmtdate that looks just like your informix function and uses Oracle's TO_CHAR and TO_DATE conversion functions

what's your calling context for the informix function (C code as Steve guessed)?
will you still be working with the informix internal date format as your source date, or do you simply need to format oracle dates as they are retrieved from the database?

++ mcs Received on Mon Jan 23 2006 - 08:14:30 CST

Original text of this message

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