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

In This Topic
    ExecuteStatement Method
    In This Topic
    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
    )
    Public Shared Sub ExecuteStatement( _
       ByVal geodatabase As Geodatabase, _
       ByVal statement As String _
    ) 

    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