Update Features Using SQL
Description
Updates features in a table by performing a query on a table using an MI SQL Update command string. In some cases the table will need a primary key column, depending on the data provider and the query. See the MapInfo SQL Language Reference for detailed information on MapInfo SQL functions.
ACL Authorization Flow
To update features in a named table by performing a query on a table using an MI SQL Update command string, the user (or any roles they belong to) will need Execute and Modify permissions on the named table in the following manner:
- “EXECUTE” for entity type “Location Intelligence.Named Resources” for the user.
- ”MODIFY” for entity type “Location Intelligence.Dataset.DML” respectively
HTTP POST URL Format
The following format is used for HTTP POST requests:
HTTP POST: /FeatureService/tables/features.rep?
POST Data: [update=MI SQL query]
POST BODY: Content-Type:application/json {bound parameters}
Parameters
The {bound parameters} is a POST json body (Content-Type: application/json) for the MI SQL update query containing one or multiple parameters to be included. Null values are supported; however, a type is still required.
For more information on parameter types, see Request URL Data Types.
Parameter | Type | Required | Description |
---|---|---|---|
rep | String | yes | The representation to be returned. Supported representation is json. |
update=MI SQL query | String | yes | The update query to perform, in MI SQL format. |
Returns the number of successfully updated features in a named table in the repository.
Example
Updates features for MyTable using a bound parameter.
http://<hostname>:<port>/rest/Spatial/FeatureService/tables/features.json?
update=UPDATE "/Samples/NamedTables/MyTable" where Column1=@stringParam
{
"parameters" : [
{
"name" : "stringParam"
"value" : "stringVal"
}
]
}