In Interactive SQL, you can view a geometry as an image using the Spatial Preview tab to understand what the data in the database represents.
Prerequisites
Permissions to select from the table containing the spatial data.
Context and remarks
Each instance of Interactive SQL is associated with a different connection to a database. When you open an instance of the Spatial Viewer from within Interactive SQL, that instance of Spatial Viewer remains associated with that instance of Interactive SQL, and shares the connection to the database.
This means that when you execute a query in the Spatial Viewer, if you attempt to execute a query in the associated instance of Interactive SQL, you get an error. Likewise, if you have multiple instances of the Spatial Viewer open that were created by the same instance of Interactive SQL, only one of those instances can execute a query at a time; the other instances must wait for the query to finish.
By default, Interactive SQL truncates values in the Results pane to 256 characters. If Interactive SQL returns an error indicating that the full column value could not be read, increase the truncation value. To do this, click Tools » Options and click SQL Anywhere in the left pane. On the Results tab, change Truncation Length to a high value, such as 5000. Click OK to save your changes, and execute the statement again.
Connect to your database in Interactive SQL.
Execute a query to select spatial data from a table. For example:
SELECT * FROM spatial-table; |
Double-click any value in the Shapes column in the Results pane to open the value in the Value window.
The value is displayed as text on the Text tab of the Value window.
Click the Spatial Preview tab to see the geometry as a Scalable Vector Graphic (SVG).
Example
Connect to the sample database and execute the following query:
SELECT * FROM SpatialShapes; |
Double-click the any value in the Shapes column in the Results pane to open the value in the Value window.
The value is displayed as text on the Text tab of the Value window.
Click the Spatial Preview tab to see the geometry as a Scalable Vector Graphic (SVG).
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |