From: Carlos G.A. <car...@ho...> - 2002-08-06 13:32:27
|
Hello: I´m making test to the driver with the microsoft odbc test program, this program have an option for creating a table, a index in the table, make a select and insert data in the table created, using the information returned by SQLGetTypeInfo, well, the 3 first steps works well but the insert of data fails, i made a fix for this: IscStatement.h Add this at line 91: /* * Values for state: * 0 = preparado * 1 = ejecutado */ int state; IscStatement.cpp IscStatement::IscStatement(IscConnection *connect): Add this: state = 1; IscStatement::getResultSet() Change : if (outputSqlda.sqlda->sqld < 1) throw SQLEXCEPTION (RUNTIME_ERROR, "current statement doesn't return results"); for: if ( state == 1 ) if (outputSqlda.sqlda->sqld < 1) throw SQLEXCEPTION (RUNTIME_ERROR, "current statement doesn't return results"); IscStatement::prepareStatement(const char * sqlString) Add this at the end: state = 0; IscStatement::execute() Add this before return: state = 1; OdbcStatement::sqlPrepare(SQLCHAR * sql, int sqlLength) Move this : if( updatePreparedResultSet ) setResultSet ( statement->getResultSet() ); into try...catch block: try { if (isStoredProcedureEscape (string)) statement = callableStatement = connection->connection->prepareCall (string); else statement = connection->connection->prepareStatement (string); if( updatePreparedResultSet ) setResultSet ( statement->getResultSet() ); } catch (SQLException& exception) { postError ("HY000", exception); return SQL_ERROR; } Best regards Carlos Guzmán Álvarez Vigo-España _________________________________________________________________ MSN Fotos: la forma más fácil de compartir e imprimir fotos. http://photos.msn.es/support/worldwide.aspx |