MapGuide API Reference
 All Classes Functions Variables Enumerations Enumerator Friends
virtual INT32 MgFeatureService::ExecuteSqlNonQuery ( MgResourceIdentifier resource,
CREFSTRING  sqlNonSelectStatement,
MgParameterCollection parameters,
MgTransaction transaction 
) [pure virtual]

Executes SQL statements NOT including SELECT statements within the given transaction.

Remarks:
The XML returned by MgFeatureService::GetCapabilities says whether a provider supports SQL commands. See Provider Capabilities .
.NET Syntax
virtual int ExecuteSqlNonQuery(MgResourceIdentifier resource, string sqlNonSelectStatement);
Java Syntax
virtual int ExecuteSqlNonQuery(MgResourceIdentifier resource, String sqlNonSelectStatement);
PHP Syntax
virtual int ExecuteSqlNonQuery(MgResourceIdentifier resource, string sqlNonSelectStatement);
Parameters:
resource(MgResourceIdentifier) A resource identifier for a feature source.
sqlNonSelectStatement(String/string) The SQL statement that is NOT a SELECT statement.
parameters(MgParameterCollection) Parameters binded to the SQL statement.
transaction(MgTransaction) The MgTransaction instance on which the sql statement will be executed.
Returns:
Returns a positive integer value indicating how many instances (rows) have been affected.
Example (PHP)
 $sql = "update featclass set abyte = 37 where featid = :id";
 $prop = new MgInt32Property("id", 150);
 $param = new MgParameter($prop);
 $params = new MgParameterCollection();
 $params->Add($param);
 $transaction = $featureService->BeginTransaction($activeFeatSrcResId);
 $numRows = $featureService->ExecuteSqlNonQuery($activeFeatSrcResId, $sql, $params, $transaction);
 $transaction->Commit();
Exceptions:
MgFeatureServiceException
MgInvalidArgumentException
MgInvalidOperationException
MgFdoException
Since:
2.2