Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Binding a NUMBER parameter through ODBC
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