int OGRMSSQLSpatialTableLayer::FetchSRSId() { CPLODBCStatement oStatement = CPLODBCStatement( poDS->GetSession() ); oStatement.Appendf( "select srid from geometry_columns " "where f_table_schema = '%s' and f_table_name = '%s'", pszSchemaName, pszTableName ); if( oStatement.ExecuteSQL() && oStatement.Fetch() ) { if ( oStatement.GetColData( 0 ) ) nSRSId = atoi( oStatement.GetColData( 0 ) ); } return nSRSId; }
int OGRMSSQLSpatialTableLayer::GetFeatureCount( int bForce ) { GetLayerDefn(); if( TestCapability(OLCFastFeatureCount) == FALSE ) return OGRMSSQLSpatialLayer::GetFeatureCount( bForce ); ClearStatement(); CPLODBCStatement* poStatement = BuildStatement( "count(*)" ); if (poStatement == NULL || !poStatement->Fetch()) { delete poStatement; return OGRMSSQLSpatialLayer::GetFeatureCount( bForce ); } int nRet = atoi(poStatement->GetColData( 0 )); delete poStatement; return nRet; }