Options

The options for Write Spatial Data depend on the type of operation you want to perform: Insert, Update by Filter, Update by Primary Key, Delete by Filter, or Delete by Primary Key.

Operation Tab

Table 1. Write Spatial Data Options

Option

Description

Named table

The name of the named table resource where you insert, update, or delete the spatial data. Initially, this field is empty. Click the Browse button to choose a writable table from the list of available tables in the repository. For instructions on creating a writable named table, see Creating Named Tables. If you select a non-writable named table, an error appears to the right of the field indicating that the named table is read-only and to select a writable table. In the case of an error in determining whether or not the table is writable, the table is deemed to be read-only and additional error information is shown. Named tables with composite primary keys are also considered to be read-only.

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 Access Control for Datasets in the Administration section for more information.

Once you have selected the named table, the fields below the named table field will be populated. If the fields are not populated and you see a validation error ("You must include at least one data field to write to table") when attempting to save the stage, there may be a problem with the named connection details for the table. Open the wrapper.log to find the I/O exceptions.

Delete existing records This check box is available only for the Insert operation. Use it to delete all existing records in the table prior to Insert.
WHERE This field is available only for the Update by Filter or Delete by Filter operations. Type the contents of a MI SQL WHERE clause in this field to specify update or delete conditions, omitting the word WHERE. For example, enter STATE_NAME in ('New York', 'New Jersey') if you are using the STATES table. Click Verify to ensure that the WHERE clause works properly. See the MapInfo SQL Language Reference for detailed information on MI SQL commands and functions. Any column, including read-only and primary key columns, can be used in the WHERE clause.
Feature Attribute The Feature Attribute column returns the writable columns and primary keys in the named table you selected (these cannot be changed). Serial columns, for example, are treated as read-only and are therefore not available in the Write Spatial Data stage.
Note: Read-only primary keys are returned for the Update by Primary Key or Delete by Primary Key operation but appear in a disabled state; that is, they cannot be selected.

Stage Field

The Stage Field defines the columns from the input stage to write to, update, or delete the columns in the named table (shown in the Feature Attribute column). By default the Stage Field columns are pre-populated to be the same as the Feature Attribute column. You can modify this column based on the input to the stage. Type $[ to list any upstream input fields.

Types The Types column returns the data type for the feature attribute columns in the named table (these cannot be changed).

Include

The Include column shows the fields to be inserted, updated, or deleted; at least one column must be selected.

The following rules are supported for all data providers:

Insert

  • Read-only columns or primary keys do not appear in the list of columns that you can include for an insert.
  • Writable primary keys appear in the list and are required to be included for an insert.

Update by Filter and Delete by Filter

  • Read-only columns or primary keys do not appear in the list of columns that you can include for an update or delete; however, they are allowed in the WHERE clause.
  • Writable primary keys do appear in the list and can be optionally included for an update or delete. A writable primary key should be selected only when the filter returns only one record and you want to update or delete the primary key for that record.

Update by Primary Key and Delete by Primary Key

  • Read-only columns do not appear in the list of columns that you can include for an update or delete.
  • Read-only primary keys do appear in the list for informational purposes, but are unselected and disabled (that is, you can cannot select a read-only primary key for an update or delete).
  • Writable primary keys do appear in the list, and are selected and enabled (that is, they are automatically selected but you can deselect them).

Runtime Tab

Table 2. Write Spatial Data Runtime Options

Option

Description

Batch size

The number of inserts, updates, or deletes that will be processed in a transaction, where each feature (row) is considered a single insert, update, or delete. For instance, if you are inserting 50 features into a table, and the commitInterval is set to 20, then you will have three transactions (20, 20, 10). The default value is 100.

Supported Data Types

Table 3. Write Spatial Data Supported Data Types

Type

Description

boolean

A logical type with two values: true and false

double

A numeric data type that contains both negative and positive double precision numbers between 2-1074 and (2-2-52)×21023. In E notation, the range of values double is 4.9E-324 to 1.7976931348623157E308

float

A numeric data type that contains both negative and positive single precision numbers between 2-149 and (2-223)×2127. In E notation, the range of values is 1.4E-45 to 3.4028235E38

integer

A numeric data type that contains both negative and positive whole numbers between -231 (-2,147,483,648) and 231-1 (2,147,483,647)

long

A numeric data type that contains both negative and positive whole numbers between -263 (-9,223,372,036,854,775,808) and 263-1(9,223,372,036,854,775,807)

string

A sequence of characters

list

When a field contains hierarchical data, it is treated as a "list" field. In Spectrum a list is a collection of data consisting of multiple values. For example, a field Names may contain a list of name values. This may be represented in an XML structure as a list of NAME elements wrapped in a NAMES element. It is important to note that the Spectrum list data type is different from the XML schema list data type in that the XML list data type is a simple data type consisting of multiple values, whereas the Spectrum list data type is similar to an XML complex data type

geometry

A data type representing a spatial entity (for example, point or polygon)

bytearray An array (list) of bytes