ICON
Help Center / Webservice Delete

Webservice Delete

Introduction

The delete data request can be used to delete data from one of the datasets available in your Spotzi Mapbuilder Account. You can delete single records at a time, as well as entire datasets as a whole. Delete data requests can be executed by adding a DELETE request to the "q" parameter.

DELETE FROM dataset_name
WHERE id = 12

The above statement is divided into:

Dataset list

The first section of the select query:

DELETE FROM dataset_name

States which dataset is targeted by the delete statement.

Note that if no fields are specifically targeted then the entire dataset will be deleted. Please use an UPDATE query if you'd only like to empty specific dataset fields.

Optional Qualification

The last — and optional — section of the query.

WHERE type = 'A'

This specifies which rows are to be deleted; all rows meeting the WHERE statement requirements will be deleted.

Examples

Below you will find some example queries that can be used with the Spotzi Webservice. The dataset names and fields used in these examples must be available in the requested webservice account to show a valid result.

DELETE FROM neighbourhood

The above statement deletes all records of the table "neighbourhood". After execution of the query this table will still exist; it will, however, be empty.

DELETE FROM neighbourhood
WHERE type = 'urban'

The above statement deletes all neighbourhood dataset records where type = "urban"

For more information about SQL DELETE statements, please consult the SQL section in our help center or see the official PostgreSQL tutorial.

Related blog posts

Try Spotzi for free and start finding your best-fit customers