MapGuide API Reference
 All Classes Functions Variables Enumerations Enumerator Friends
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