Precompilers and OCI (MOSC)

MOSC Banner

OCINumberToReal and SQLT_NUM

edited Apr 22, 2009 11:00PM in Precompilers and OCI (MOSC) 3 commentsAnswered
Hy,  
I have the following code :

unsigned short      datatype[255];
unsigned char      *outvar[255];
double                 num_val;
int                       i = 0;
int                       errorcode;

      if (datatype[i] == SQLT_NUM)
      {
        errcode = OCINumberToReal((OCIError *) errhp,
                       (CONST OCINumber *) outvar[i],
                       (uword) sizeof(double),
                       (dvoid *) &num_val);
        if (errcode > 0)
        {
          printf("\n");
          printf("OCINumberToReal error code is : %d \n",errcode);
        }
        else
          printf("value is %f\n",num_val);
      }

and

outvar[i] have been defined with OCIDefineByPos with char[21] as written in the 11g OCI Doc.

The problem is that there are no errors in the call to OCINumberToReal, but the value 2,22 in the database is printed as -82004701173600.000000.
In the database the SELECT retrieve values from a NUMBER datatype column.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center