Informix Error -11118: Invalid use of null pointer
Cause and resolution
Invalid use of null pointer
This Informix ODBC error code is the same as SQLSTATE value HY009. The following functions can return this error code: SQLAllocHandle, SQLBindParameter, SQLColumnPrivileges, SQLColumns, SQLExecDirect, SQLForeignKeys, SQLNativeSql, SQLPrepare, SQLPrimaryKeys, SQLProcedureColumns, SQLProcedures, SQLPutData, SQLSetConnectAttr, SQLSetCursorName, SQLSetEnvAttr, SQLSetStmtAttr, SQLSpecialColumns, SQLStatistics, SQLTablePrivileges, and SQLTables.
For SQLAllocHandle, SQLExecDirect, SQLNativeSql, SQLPrepare, SQLPutData, SQLSetConnectAttr, SQLSetCursorName, SQLSetEnvAttr, and SQLSetStmtAttr, the argument was a null pointer.
For SQLForeignKeys, SQLPrimaryKeys, SQLStatistics, SQLTablePrivileges, and SQLTables, the TableName argument was a null pointer. The SQL_ATTR_METADATA_ID statement attribute was set to SQL_TRUE, the CatalogName argument was a null pointer, and the SQL_CATALOG_NAME InfoType returns that catalog names are supported. The SQL_ATTR_METADATA_ID statement attribute was set to SQL_TRUE, and the SchemaName or ColumnName argument was a null pointer.
For SQLColumn, SQLColumnPrivileges, SQLProcedures, SQLProcedureColumns, and SQLSpecialColumns, the SQL_ATTR_METADATA_ID statement attribute was set to SQL_TRUE, the CatalogName argument was a null pointer, and the SQL_CATALOG_NAME InfoType returns that catalog names are supported.(DM) The SQL_ATTR_METADATA_ID statement attribute was set to SQL_TRUE, and the SchemaName, ProcName, or ColumnName argument was a null pointer.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-11118 fires when a required argument is passed as a null pointer — per the official
guidance, this is the same as SQLSTATE value HY009, returnable by a wide range of CLI
functions (SQLAllocHandle, SQLBindParameter, SQLColumnPrivileges, SQLColumns,
SQLExecDirect, SQLForeignKeys, SQLNativeSql, SQLPrepare, SQLPrimaryKeys,
SQLProcedureColumns, SQLProcedures, SQLPutData, SQLSetConnectAttr,
SQLSetCursorName, SQLSetEnvAttr, SQLSetStmtAttr, SQLSpecialColumns,
SQLStatistics, SQLTablePrivileges, and SQLTables).
- For
SQLAllocHandle,SQLBindParameter,SQLExecDirect,SQLNativeSql,SQLPrepare,SQLPutData,SQLSetConnectAttr,SQLSetCursorName,SQLSetEnvAttr, andSQLSetStmtAttr: a required argument was itself a null pointer, per the official guidance — the first named case. - For
SQLForeignKeys,SQLPrimaryKeys,SQLStatistics,SQLTablePrivileges, andSQLTables:TableNamewas a null pointer, or (withSQL_ATTR_METADATA_IDset toSQL_TRUEand catalog names supported)CatalogName/SchemaName/ColumnNamewas a null pointer, per the official guidance — the second named case. - For
SQLColumns,SQLColumnPrivileges,SQLProcedures,SQLProcedureColumns, andSQLSpecialColumns: withSQL_ATTR_METADATA_IDset toSQL_TRUE,CatalogName(where catalog names are supported),SchemaName,ProcName, orColumnNamewas a null pointer, per the official guidance — the third named case.
Solutions / Resolution
- Supply a non-null value for every required argument named above, per the official guidance.
- For the catalog-lookup functions, either set
SQL_ATTR_METADATA_IDtoSQL_FALSEwhen a null identifier argument is intended, or supply the required non-nullCatalogName/SchemaName/TableName/ColumnName/ProcNamevalue, per the official guidance's implication.
Examples
N/A
No specific triggering statement is documented beyond a null-pointer argument.
Diagnostic Checks
- Review each argument passed to the failing function, and confirm none of the required (non-nullable) ones are null.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -11118 in this set yet.
A required argument was passed as a null pointer — supply a non-null value.