Re: DATE datatype in Pro*c ???

From: <nsouto_at_acay.com.au>
Date: 1996/10/23
Message-ID: <54lcdi$ora_at_job.acay.com.au>#1/1


In <DzosyM.C70_at_ireq.hydro.qc.ca>, alain_at_distri.hydro.qc.ca (Alain Bibeau) writes:
>I got a problem using the DATE datatype in a Pro*C program
>let see the code :
>
>main ()
>{
> EXEC SQL BEGIN DECLARE SECTION ;
> char date_test [7] ;
> DATE toto /* Does not seem to work */
> EXEC SQL END DECLARE SECTION ;
>
> date_test [0] = 119 ; /* as describe P 3-53 Oracle guide Pro*C/C++ */
> date_test [1] = 196 ; /* date datatype */
> date_test [2] = 10 ;
> date_test [3] = 22 ; /* date 1996 OCT 22 00:00:00 */
> date_test [4] = 1 ;
> date_test [5] = 1 ;
> date_test [6] = 1 ;
>
> EXEC SQL
> INSERT INTO ALAIN /* Table ALAIN has one field ( A DATE) */
> VALUES (:date_test) ;
>}
>
>I always get the error
>
>ORA-01858: a non-numeric character was found where a numeric was expected ...
>
>Any help would be appreciated
>
>Thank's
>
>Alain Bibeau +1 514-289-7091 | "Machines work, people should think"
>Montreal, Quebec, Canada |
>alain_at_distri.hydro.qc.ca | -- Troutman's programming laws

Hi Alain.

I think the problem may be you're sending binary data in a char field. I always do:
char date_test[9]; Received on Wed Oct 23 1996 - 00:00:00 CEST

Original text of this message