Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: OCI & DATES & PreparedStatements

Re: OCI & DATES & PreparedStatements

From: Antonio Pascual <apa_at_jerez.micro.lucent.com>
Date: Tue, 29 Jun 1999 12:34:20 +0200
Message-ID: <7la7ja$rt1@nntpa.cb.lucent.com>


STOP ALL.
I've found the problem.
To the one who whats to know the problem.

I was inserting in the 6th position (EXTERNAL DATATYPE) of the obndrv binding function, DATE_TYPE(internal type) instead of STRING_TYPE(external type).

      if
ndrv(

                        &m_Cda,                                                             // Cursor
                        (text *)szPlaceHolder,                                           // Name of host variable
                        -1,                                                                      // Used only with obndrn           
                        (ub1 *)pSRecord->FieldValue.strValue,                  // Address of the variable to bind
                        (sword)pSRecord->FieldSize,                                // variable size
-------->            DATE_TYPE,                                                        // The Oracle external datatype
                        -1,                                                                      // Only for PACKED DECIMAL variables
                        (sb2 *) 0,                                                            // 
                        (text *) 0,                                                            // Not used in C programs
                        -1,                                                                      // Not used in C programs 
                        -1                                                                       // Not used in C program
                        ) 
        )

Antonio Pascual <apa_at_jerez.micro.lucent.com> wrote in message news:7la343$r01_at_nntpa.cb.lucent.com...
> HI ALL AND GOOD DAY.
>
> I have a problem and i don't know if the trouble is with Oracle.
>
> I have a sentence like this:
>
> INSERT INTO OCICTEST ( INT_VALUE, STRING_VALUE, DATE_VALUE )
> VALUES ( :INT_VALUE, :STRING_VALUE, TO_DATE( :DATE_FIELD, 'DD MM YYYY' ))
>
> When i do the binding to the :DATE_FIELD placeholder, i put, for example,

> '29 06 1999' in the string to bind.
> Allways get the same error:

>

> ORA-01847: day of month must be between 1 and last day of month.
>

> The way i do the binding for the :DATE_FIELD placeholder is the same like
> with :STRING_VALUE.
> In both cases i use a char * for the variable to bind.
>

> regards.
>
>
>
>
>


Received on Tue Jun 29 1999 - 05:34:20 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US