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

From: Gary Piper <gpiper_at_ozemail.com.au>
Date: 1996/11/02
Message-ID: <327B9CB9.5651_at_ozemail.com.au>#1/1


Min Wang wrote:
>
> 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));
>
> }
>
> Thank you.
> --
> Min Wang
> E-mail: mwang_at_colorbank.com
> http://www.colorbank.com/

Min,

Why dont you use EXEC SQL INSERT INTO table_name ( column_name )

                          SELECT sysdate
                            FROM dual;
               
                 EXEC SQL COMMIT;

Let Oracle do the work..

Regards Gary

~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ Gary Piper ( gpiper_at_ozemail.com.au )
http://www.ozemail.com.au/~gpiper/


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

Original text of this message