ArcGIS Pro 3.7 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 Shared Sub ExecuteStatement( _
       ByVal geodatabase As Geodatabase, _
       ByVal statement As String _
    ) 
    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
      void ExecuteSQLOnGeodatabase(Geodatabase geodatabase, string statement)
      {
        //Must be on QueuedTask.Run
        DatabaseClient.ExecuteStatement(geodatabase, statement);
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also