ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Data Namespace / DatabaseClient Class / ExecuteStatement Method
A valid instance of Geodatabase
A valid SQL statement.
Example Version

ExecuteStatement Method
Executes a specific statement on the database management system specified by geodatabase. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public static void ExecuteStatement( 
   Geodatabase geodatabase,
   string statement
)

Parameters

geodatabase
A valid instance of Geodatabase
statement
A valid SQL statement.
Exceptions
ExceptionDescription
geodatabase is null.
A geodatabase-related exception has occurred.
Example
Executing SQL Statements
// Executes raw SQL on the underlying database management system.
//  Any SQL is permitted (DDL or DML), but no results can be returned
public void ExecuteSQLOnGeodatabase(Geodatabase geodatabase, string statement)
{
    QueuedTask.Run(() =>
    {
        DatabaseClient.ExecuteStatement(geodatabase, statement);
    });
}
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also