I've got an insert into a table using ODBC 3.0 on Oracle 10g that is failing and I have no idea why. The database is on Windows Server 2003. The client is on Windows XP.
The table:
CREATE TABLE test ( testcol NUMBER(20,0) NULL );
The ODBC calls:
SQLAllocHandle(SQL_HANDLE_STMT) = SQL_SUCCESS
SQLPrepare(INSERT INTO test (testcol) VALUES (?);) = SQL_SUCCESS
SQLINTEGER nStrLen = 0;
__int64 nInt64 = 99;
SQLBindParameter(hStatement, 1, SQL_PARAM_INPUT,
SQL_C_SBIGINT, SQL_BIGINT, 20, 0, &nInt64, 0, &nStrLen) = SQL_SUCCESS
SQLExecute() = SQL_ERROR
SQLGetDiagRec(1) = SQL_NO_DATA
SQLBindParameter
succeeds but then SQLExecute
fails. There is no diagnostic message.
I have had to resort to writing the int64 to a string and binding it as a string. Is this the only way to bind a int64?