ICON
Help Center / Webservice Insert /

Webservice Insert

Introduction

The "insert" data request can be used to populate datasets available in your Spotzi Account with new data. You can insert single or multiple records at a time. "Insert" data requests can be executed by including an INSERT request with the "q" parameter.

Basic INSERT query

A typical insert query is generally as follows:

INSERT INTO name_dataset ('CODE','NAME','NUMBER')
VALUES ('A','B',3)

The above statement is divided into:


Field list

The field list:

INSERT INTO name_dataset ('CODE','NAME','NUMBER')

States which fields need to be inserted via the insert statement. While specifying these fields is not mandatory, it is strongly advised — If no fields are specified then the insert statement will expect all available fields to be inserted.

Value list

The second section of the insert query is the value list:

VALUES ('A','B',3);

This list states which values need to be inserted.

The columns described in the first part of this query must exist within the dataset for the query to work, and must also match the column type of the given values. Values that are not simple numeric values must usually be surrounded by single quotes (') such as in the following examples.

Examples

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

INSERT INTO neighbourhood (neighbourhood_name, total_population)
VALUES ('Centre',100)

The above statement inserts a new record in the neighbourhood dataset with the neighbourhood_name "Centre" and a total_population of 100.

INSERT INTO neighbourhood (neighbourhood_name, total_population)
VALUES ('Centre', 100),('North',50)

The above statement inserts two records into the neighbourhood dataset simultaneously.

For more information about SQL INSERT statements please visit the SQL section in our help center, or the official PostgreSQL tutorial.

Related blog posts

Gain Instant Access to a World of Maps

Spotzi Explorer is an integrated data catalog that lets you quickly and easily add data to your dashboards. Access a rich collection of maps and dashboards—explore postal codes, discover global income insights, or get inspired by maps created by our community. It’s the ideal tool for marketers, researchers, students, and anyone looking to enhance their market research, plan an OOH campaign, or work with location data.

Postal Codes Map
Create your free account Browse Datasets

Ready to turn your data into insights?

Spotzi's platform streamlines the process of geomarketing research & analysis by providing you with a one-stop-shop for all of your mapping and location data needs.

Are you ready to take your campaigns to the next level? Contact us to learn more about our plans.

Contact us

Contact

Spotzi North America
  • 125-720 King Street West
  • Toronto ON M5V 3S5
  • Canada
Spotzi Europe
  • Joulehof 9
  • 4622 RG Bergen op Zoom
  • The Netherlands