deleteByPrimaryKey

Description

Deletes features from a table using a list of primary keys with an optional commitInterval. Each feature must have an ID (primary key) which is used to match it with the feature in the table. The response contains the number of features that were successfully deleted.

Note: You must have View permissions on the named table as well as Create/Modify/Delete permissions on the named table's associated dataset to perform insert, update, and delete operations on writable tables. See Users and Roles in the Administration section for more information.
The default value for the commitInterval is 50; therefore, the first 50 updates will be committed within one transaction. If the value is less than 1, the default value of 50 is used. It is not recommended to set this value to 1 as one transaction will be used for one update.
Note: This operation is supported for PostGIS, Oracle, SQL Server, GeoPackage, and generic JDBC data providers. It also supported on MapInfo native TAB and extended native TAB (NativeX) files (the commitInterval is ignored). The tables must have a primary key or they will be considered read-only. Named tables with composite primary keys are not writable.

ACL Authorization Flow

To delete features in a named table, the user (or the role they belong to) needs both EXECUTE and DELETE permission on the Named table.

Messages

The following table lists the request and response messages for the deleteByPrimaryKey operation.

Click on a message name to get more information about the message.

Message Description
DeleteByPrimaryKeyRequest The request message for the deleteByPrimaryKey operation.
DeleteByPrimaryKeyResponse The response message for the deleteByPrimaryKey operation.

Example

Example for deleting features in an Oracle table by primary key. The FeatureKeyList defines the values to be deleted:

<?xml version="1.0"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"
		xmlns:ns4="http://www.mapinfo.com/midev/service/feature/v1">
	<S:Header/>
		<S:Body>
			<ns4:DeleteByPrimaryKeyRequest table="/Samples/OraWorld" commitInterval="50">
				<ns4:FeatureKeyList>
					<ns4:key>1</ns4:key>
					<ns4:key>2</ns4:key>
					<ns4:key>3</ns4:key>
				</ns4:FeatureKeyList>
			</ns4:DeleteByPrimaryKeyRequest>
		</S:Body>
</S:Envelope>