Showing posts with label Interactive SQL. Show all posts
Showing posts with label Interactive SQL. Show all posts

Monday, December 5, 2016

Is there a spatial data visualizer on SQL Anywhere 17?

The short answer is yes.

Following globalization and opening of data centers all over the world, visualizing spatial data has become urgent and is supported by applications as well as databases.

SQL Anywhere 17 does have a spatial data viewer and you will have to invoke it in the Interactive. The procedure is as follows:

There is table called SpatialShapes in the 'demo' database which has several geometric shapes in each row of it's SpatialShapes table.

After connecting to the 'demo' database right click the SpatialShapes(GROUPO) table to reveal a drop-down list as shown.


SpatialGeom_00

In the above drop-down pick the first option, View data in Interactive SQL. The Interactive SQL windows appears as shown with a Select query.

SpatialGeom_01

Click Tools to display the drop-down list.

SpatialGeom_02

Click Spatial Viewer in the list to open the Spatial Viewer1 window as shown.




SpatialGeom_03

 Click Execute at the bottom of the above window to display the graphic view of the data which consists of a variety of geometrical shapes as shown.




SpatialGeom_04

Wednesday, November 23, 2016

How do you retrieve JSON formatted data from SQL Anywhere 17?

SQL Anywhere 17 is a SAP Database.  Some of the earlier versions were released by SYBASE.

In SQL Anywhere 17 you have three different ways of getting JSON formatted data / JSON document.

You can use the FOR JSON clause  with:

  • SELECT Statement
  • Subqueries
  • Queries having Group By clause
  • Aggregate Functions and
  • Views
The result is a JSON array consisting of:

  • Scalar elements
  • Objects
  • Arrays
There are three ways of calling the FOR JSON Clause:

  • For JSON Raw
  • For JSON AUTO
  • For JSON Explicit
Note that SQL Server 2016 did get JSON support for the first time and has only For JSON Auto clause.

You run SQL Queries in Interactive SQL. Here is an example of a query that provides json document using the FOR JSON AUTO clause.


InteractiveSQL17JSON