Re: How to write current time into Oracle with Pro*c?

From: <seci_at_ludens.elte.hu>
Date: 1996/11/02
Message-ID: <1996Nov2.091227.33312_at_ludens>#1/1


hi,

In article <32790079.41C6_at_colorbank.com>, Min Wang <mwang_at_colorbank.com> writes:
> Hi,
>
> I want to write current date into Oracle with Pro*c.
> When I test the following codes alone, it was OK. But when I tried
> insert them into a Pro*c program, it got problem. Does any one know how
> to do in right way?
> I use SGI indy with IRIX 5.3.
>
> #include <stdio.h>
> #include <time.h>
>
> main(){
>
> time_t now;
> time(&now);
> printf("%s",ctime(&now));
>
> }

why do you use this complicated mothod to use the current time in oracle ? use sysdate instead - because it is the correct date & time from the database servers point of view!

if you need only the time (and not the date) use to_char(sysdate,'HH24:MI:SS')  

>
>
> Thank you.
> --
> Min Wang
> E-mail: mwang_at_colorbank.com
> http://www.colorbank.com/

THT
        peter Received on Sat Nov 02 1996 - 00:00:00 CET

Original text of this message