Map service GetSQLSyntaxInfo method

Gets the SQL syntax information for the specified layer.

GetSQLSyntaxInfo(string MapName, int LayerID)

Parameter

Description

MapName

The name of the map (data frame) that contains the layer to be queried.

LayerID

The layer id of the layer on which SQL syntax information will be retrieved.

Return Value

A SQLSyntaxInfo object containing information about the SQL capabilities of the specific layer.

Remarks

Using the appropriate SQL syntax and being aware of layer capabilities is important when creating queries for layer content. The appropriate SQL syntax that can be used with a layer depends on the database in which it is managed.

Examples

C#

MapService_MapServer mapservice = new MapService_MapServer();

mapservice.Url = "http://localhost:6080/arcgis/services/MapService/MapServer";

string mapname = mapservice.GetDefaultMapName();

MapServerInfo mapinfo = mapservice.GetServerInfo(mapname);

MapDescription mapdesc = mapinfo.DefaultMapDescription;

LayerDescription[] layerdescriptions = mapdesc.LayerDescriptions;

foreach (LayerDescription layerdesc in layerdescriptions)

{

      SQLSyntaxInfo sqlsyntaxinfo = mapservice.GetSQLSyntaxInfo(mapname, layerdesc.LayerID);

}

VB.NET

Dim mapservice As MapService_MapServer = New MapService_MapServer()

mapservice.Url = "http://localhost:6080/arcgis/services/MapService/MapServer"

 

Dim mapname As String = mapservice.GetDefaultMapName()

Dim mapinfo As MapServerInfo = mapservice.GetServerInfo(mapname)

Dim mapdesc As MapDescription = mapinfo.DefaultMapDescription

 

Dim layerdescriptions() As LayerDescription = mapdesc.LayerDescriptions

Dim layerdesc As LayerDescription

 

For Each layerdesc In layerdescriptions

      Dim sqlsyntaxinfo As SQLSyntaxInfo = mapservice.GetSQLSyntaxInfo(mapname, layerdesc.LayerID)

Next

Java

String serviceURL = "http://localhost:6080/arcgis/services/MapService/MapServer";

MapServerBindingStub mapService = new MapServerBindingStub(serviceURL);

 

String mapName = mapService.getDefaultMapName();

MapServerInfo mapInfo = mapService.getServerInfo(mapName);

 

MapDescription mapDesc = mapInfo.getDefaultMapDescription();

LayerDescription[] layerDescriptions = mapDesc.getLayerDescriptions();

for(LayerDescription layerDesc:layerDescriptions)

{

      SQLSyntaxInfo sqlSyntaxInfo = mapService.getSQLSyntaxInfo(mapName, layerDesc.getLayerID());

      String[] supportedClauses = sqlSyntaxInfo.getSupportedClauses();

 

      for (String supportedClause : supportedClauses) {

            System.out.println("Layer ID: " + layerDesc.getLayerID());

            System.out.println("Supported Clause: " + supportedClause);

      }

}

11/8/2016