Loading spatial data from a Well Known Text (WKT) file

You can add spatial data to a table by using a Well Known Text file (WKT) that contains text that can be used to load spatial data into a database and be represented as geometry.

Prerequisites

The privileges required to load data depend on the -gl server option. If the -gl option is set to ALL, one of the following must be true:

If the -gl option is set to DBA, you must the LOAD ANY TABLE or ALTER ANY TABLE system privilege.

If the -gl option is set to NONE, LOAD TABLE is not permitted.

When loading from a file on a client computer:

Task
  1. Create a file that contains spatial data in WKT format that you can load into the database.

    The file can be in any format supported by the LOAD TABLE statement.

  2. In Interactive SQL, connect to your database.
  3. Create a table and load the data from the file into using a statement similar to the following:
    DROP TABLE IF EXISTS SA_WKT;
    CREATE TABLE SA_WKT (
        description CHAR(24),
        sample_geometry ST_Geometry(SRID=1000004326)
    );
    
    LOAD TABLE SA_WKT FROM 'C:\\Documents and Settings\\All Users\\Documents\\SAP Sybase IQ 16\\Samples\\wktgeometries.csv' DELIMITED BY ',';

    The data is loaded into the table.

The spatial data is successfully loaded from the WKT file.

Next

You can view the data in Interactive SQL using the Spatial Viewer.