DATE datatype in Pro*c ???

From: Alain Bibeau <alain_at_distri.hydro.qc.ca>
Date: 1996/10/22
Message-ID: <DzosyM.C70_at_ireq.hydro.qc.ca>#1/1


[Quoted] [Quoted] 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
Received on Tue Oct 22 1996 - 00:00:00 CEST

Original text of this message