AutoCAD Map 3D 2009 Geospatial Platform Reference

AutoCAD Map 3D Geospatial Platform API

virtual MgSqlDataReader* MgFeatureService::ExecuteSqlQuery ( MgResourceIdentifier resource,
CREFSTRING  sqlStatement 
) [pure virtual]

Executes the SQL SELECT statement on the specified feature source.

Remarks:
The XML returned by MgFeatureService::GetCapabilities says whether a provider supports SQL commands. See Provider Capabilities .
.NET Syntax
virtual MgSqlDataReader ExecuteSqlQuery(MgResourceIdentifier resource, string sqlStatement);
Java Syntax
virtual MgSqlDataReader ExecuteSqlQuery(MgResourceIdentifier resource, String sqlStatement);
PHP Syntax
virtual MgSqlDataReader ExecuteSqlQuery(MgResourceIdentifier resource, string sqlStatement);

Parameters:
resource (MgResourceIdentifier) A resource identifier referring to a feature source.
sqlStatement (String/string) The SQL SELECT statement.
Returns:
Returns an MgSqlDataReader instance (or NULL).
Note:
If any statement other than SELECT is passed to this method, it will throw an MgFdoException.
Example (PHP)
 $sql = "select featid,abyte from featclass where featid = 0";
 $sqlDataReader = $featureService->ExecuteSqlQuery($activeFeatSrcResId, $sql);

Exceptions:
MgFeatureServiceException 
MgInvalidArgumentException 
MgInvalidOperationException 
MgFdoException