Home    |    Concepts   |   API   |   Samples
Concepts > Schema Objects > Layers
Deleting Features
Similar to data updates, deleting data through the ArcSDE API involves selecting which features to delete, then executing the statement to delete the rows from the table.

In this example, the city of Hull was incorporated into the city of Aylmer during Aylmer’s expansion. You need to delete the city of Hull. An SQL statement is used to delete the records from a table named cities where city_name = 'Hull'. The shape and spatial index records are deleted through triggers that ArcSDE maintains on the cities table.

/* Formulate the SQL statement to delete Hull */
strcpy (sql_stmt, "delete from cities where city_name = 'Hull'");

/* Initialize the stream with a pass-through SQL operation */
rc = SE_stream_prepare_sql (stream, sql_stmt);
check_error(NULL, Stream, rc, "SE_stream_prepare_sql");

/* Execute the SQL statement */
rc = SE_stream_execute (stream);
check_error(NULL, Stream, rc, "SE_stream_execute");

feedback | privacy | legal