sqldata/sqlctapi.cpp
// Set version of the connected database
Set version of the connected database
Set version of the connected database
void SqlCtApi::SetVersion()
{
	std::string query = "SELECT @@version";
	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.c_str(), 1, 0, &col_count, &allocated_rows, &rows_fetched, &cols, &time_read, true);
	if(rc >= 0 && cols != NULL && cols[0]._ind2 != NULL && cols[0]._ind2[0] != -1)
		_version.append(cols[0]._data, (size_t)cols[0]._len_ind4[0]);
	CloseCursor();
}
void SqlCtApi :: SetVersion ( ) { std :: string 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 . c_str ( ) , 1 , 0 , & col_count , & allocated_rows , & rows_fetched , & cols , & time_read , true ) ; if ( rc >= 0 && cols != NULL && cols [ 0 ] . _ind2 != NULL && cols [ 0 ] . _ind2 [ 0 ] != -1 ) _version . append ( cols [ 0 ] . _data , ( size_t ) cols [ 0 ] . _len_ind4 [ 0 ] ) ; CloseCursor ( ) ; }
Set version of the connected database
Set version of the connected database
// Tested on Sybase 16 // Open cursor  // Get the version value