Re: Pro*C Insert Date/Time

From: (wrong string) ørgensen <kjorg_at_msn*DOT*com>
Date: 1998/01/18
Message-ID: <uvrqk#$I9GA.217_at_upnetnews04>#1/1


Your first attempt (using the to_date() function with a format) looks spot-on.

>It just dont work?
Then give us some error messages to work with ! I suspect that the format of the date in the :ds.date_time_entered variable doesn't quite match the format you specify in to_date(), but without the error messages, I'm not quite sure.
By the way, I'm assuming that :ds.date_time_entered is a string.

--
Hope this helps

Karl
Oracle Certified DBA

Charles M Amorose <72520.2374_at_CompuServe.COM> wrote in message ...

>I am trying to write a program that will read records from MS-SQL
>(6.5)
>and the insert them into Oracle (8.0.3.0.0).
>
>What is the exact syntax for inserting a date/time field in
>Pro*C?
>
>1st Attempt:
> EXEC SQL AT DB_NAME INSERT INTO TEST_ORD
> values(:ds.tag,
> :omk,
> to_date(:ds.date_time_entered,'DD MON YYYY
>HH24:MI:SS'));
>
>2nd:
>sprintf(dte,"to_date(\'%s\',\'DD MON YYYY
>HH24:MI:SS\')",ds.date_time_entered);
>
> EXEC SQL AT DB_NAME INSERT INTO TEST_ORD
> values(:ds.tag,
> :omk,
> :dte);
>
>It just dont work?
>
>
>--
>CMA
Received on Sun Jan 18 1998 - 00:00:00 CET

Original text of this message