Re: ERROR[07006]...violation (SQL_C_NUMERIC)

Jess Balint <[email protected]>
Newsgroups gmane.comp.db.mysql.odbc
Message-ID <[email protected]>
On Sat, Mar 31, 2007 at 07:18:36PM -0800, Bruce Norgan wrote:
> A server error occurs upon execution of "ERROR[07006][MySQL][ODBC 3.51 Driver][mysqld-4.0.27-max-log] Restricted data type attribute violation (SQL_C_NUMERIC)."  There is no mention of this SQLSTATE error in the MySQL documentation of Appendix C.1 (server) or C.2 (client).

This error is returned from SQLBindParameter, and is an ODBC state (not
MySQL-specific). See:

http://msdn2.microsoft.com/en-us/library/ms710963.aspx

> One reference says that when data is retrieved from a decimal field the ODBC driver uses a SQL_C_NUMERIC data conversion type.  However, if the driver does not support the type then an error may occur.  ODBC 3.0 drivers are supposed to have this C data type to allow applications to directly handle numeric data.  The MySQL, ODBC 3.51 driver supposedly handles these types.

The type refered to (SQL_C_NUMERIC) is a special structure used for
precise representation of floating point values. MySQL Connector/ODBC v3
does not support this, but it supported in the beta v5 driver.

Code reference (driver/prepare.c:245):

---------------
    if (fCType == SQL_C_NUMERIC) /* We don't support this now */
    {
        set_error(stmt,MYERR_07006,
                  "Restricted data type attribute violation(SQL_C_NUMERIC)",0);
        MYODBCDbgReturnReturn(SQL_ERROR);
    }
---------------

Hope this helps,

Jess


-- 
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.