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 -> Binding a NUMBER parameter through ODBC

Binding a NUMBER parameter through ODBC

From: Ben Hutchings <do-not-spam-benh_at_bwsint.com>
Date: Wed, 21 Jul 2004 16:14:47 +0100
Message-ID: <slrncft237.pld.do-not-spam-benh@shadbolt.i.decadentplace.org.uk>


I am having trouble providing large numbers as statement parameters in Oracle 8 using ODBC. I fill out an SQL_NUMERIC_STRUCT and use the application type code SQL_NUMERIC. This works with SQL Server 2000. However, Oracle returns the error "ORA-03115: unsupported network datatype or representation". Does this mean SQL_NUMERIC is not supported? If so, how should I pass large numbers?

Here's what I'm doing to bind the number:

    SQL_NUMERIC_STRUCT numericVal =

        { 18, 6, 1, { 0, 164, 147, 214 } };     SQLINTEGER len = sizeof(numericVal);     SQLINTEGER ind = 0;

// appParamDesc is the Application Parameter Descriptor
    SQLSetDescRec(appParamDesc, 1, SQL_NUMERIC, 0,

                  sizeof(numericVal), 18, 6,
                  &numericVal, &len, &ind);

// impParamDesc is the Implementation Parameter Descriptor
    SQLSetDescRec(impParamDesc, 1, SQL_DECIMAL, 0,

                  0, 18, 6,
                  NULL, NULL, NULL);

The real code doesn't have these hardcoded values in, of course, and it has error-checking on each function call. The error is returned by SQLExecute and not SQLSetDescRec. Received on Wed Jul 21 2004 - 10:14:47 CDT

Original text of this message

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