sqldata/sqlifmxapi.cpp
// Set version of the connected database
Set version of the connected database
Set version of the connected database
void SqlIfmxApi::SetVersion()
{
	const char *query = "SELECT dbinfo('version', 'full') FROM systables WHERE tabid=1";
	size_t col_count = 0;
	size_t allocated_rows = 0;
	int rows_fetched = 0; 
	size_t time_read = 0;
	SqlCol *cols = NULL;
	int rc = OpenCursor(query, 1, 0, &col_count, &allocated_rows, &rows_fetched, &cols, &time_read, true);
	if(rc >= 0 && cols != NULL && cols[0].ind != NULL)
	{
		SQLLEN len = (SQLLEN)cols[0].ind[0];
		if(len != -1 && len < 127)
			_version.assign(cols[0]._data, (size_t)len);
	}
	CloseCursor();
}
void SqlIfmxApi :: SetVersion ( ) { const char * query = " " ; size_t col_count = 0 ; size_t allocated_rows = 0 ; int rows_fetched = 0 ; size_t time_read = 0 ; SqlCol * cols = NULL ; int rc = OpenCursor ( query , 1 , 0 , & col_count , & allocated_rows , & rows_fetched , & cols , & time_read , true ) ; if ( rc >= 0 && cols != NULL && cols [ 0 ] . ind != NULL ) { SQLLEN len = ( SQLLEN ) cols [ 0 ] . ind [ 0 ] ; if ( len != -1 && len < 127 ) _version . assign ( cols [ 0 ] . _data , ( size_t ) len ) ; } CloseCursor ( ) ; }
Set version of the connected database
Set version of the connected database
// Tested on Informix 11.7 (Includes product name - IBM Informix Dynamic Server Version 11.70.TC5DE)  // T means 32-bit Windows, U - 32-bit Unix, F - 64-bit Windows/Unix // Open cursor  // Get the value