Modify Feature (Queries)

From GeoMedia Smart Client
Jump to: navigation, search
Edit Feature General Symbols Queries Label Copyright Additional Settings





In GeoMedia Smart Client, you are able to provide predefined queries to be executed on the client by the users. There are three kinds of queries; Smart Client identifies each kind of query through certain characters within the statement.

Search with selection

The user selects one or more elements in the map to get the information specified in the query sql-string. Use the following string and placeholder:

 SELECT ... FROM TABLE WHERE PRIMKEYKEYFIELD IN ({ENTITY.SELECTIONSET})



Search with input

The query defines the attributes the user may search with. Use the following sql-string and add the placeholder for the attribute.

SELECT ... FROM TABLE WHERE attribute = {ENTITY.ATTRIBUT}



Combined search

The two modes shown above may be be executed together. The necessary string is a combination of both kinds of placeholders:

SELECT ... FROM TABLE WHERE PRIMKEYKEYFIELD IN ({ENTITY.SELECTIONSET}) AND attribute = {ENTITY.ATTRIBUTE}


Query form.png

The queries will be executed in the database directly so you can use any sql function that your database provides.

- Click Editquery.png to edit the query. Here you can also Delete your query. - Click Testquery.png to test the syntax of your query. - Click New to open a modal form to define the query. Complete the form and click SAVE.


Querymodal form.png



Pfeil new.png To the top Pfeil new.png

Examples

Search with selection

This query enables you to highlight one or more geometry elements from the map and get specific information about these elements.
Your query will be named Information Highways by MapSelection; no description is added.

The result feature can be any activatable feature class.

  • Example 1: Select attributive information (ID, Name, and Type) from all selected Autobahn Features:


Query example2.png



  • Example 2: Select all Parcel polygons that spatially relate to Property polygons and which show their attributive information. We use SDO_RELATE to relate parcels to properties:

Query Example SDORelate.png



  • Example 3: Query all attributive information of Parcels and Properties and merge it to one data table:

Query Example AttributiveJoin1.png



Pfeil new.png To the top Pfeil new.png

Search with input

You would like to search for certain highways by name and get specific information about them.

Your query will be named Information Highways; a description Please type in a highway name is added. The result feature can be any activatable feature class. The sql-string will offer name and type to the user.

Query example1.png



Pfeil new.png To the top Pfeil new.png

Combined search

In the following example, we are showing how to merge and obtain records from two related tables. So we alias the table PARCELS as A and the table ADDRESS_POINTS as B. This query will allow you to query for a particular owner name from selected parcels and also to return the unit value from the Address_Points table. The parcels are related to the address_points by the attributes of Parcel_ID.

Query example3.png



Pfeil new.png To the top Pfeil new.png

Using like operator

To use a like operator, a special syntax with wild-card(s) is necessary:
SELECT ID, KG, GSTNR, AREA FROM GST WHERE KG LIKE {ENTITY.%Kg}
SELECT ID, KG, GSTNR, AREA FROM GST WHERE KG LIKE {ENTITY.Kg%}
SELECT ID, KG, GSTNR, AREA FROM GST WHERE KG LIKE {ENTITY.%Kg%}



Pfeil new.png To the top Pfeil new.png

Query if the source feature isn't equivalent to the result feature

Query source result.png



Pfeil new.png To the top Pfeil new.png

Actions in datagrid

A result of a query can also show a button to call an action (for example, open an image in a browser, open a file, open a Web site). This can be done by using the following syntax:

{ACTION.actionName(parameterName)}
actionName ... name of the action to call (for example, browse, browseWorkflow, and openFile)
parameterName ... the name of the attribute to pass the value selected by the query (for example, browse => URL, openfile =>, and filename)


Example: Open www.intergraph.com

SELECT ID, KG, GSTNR, AREA, 'http://www.intergraph.com' AS "{ACTION.browse(url)}" FROM GST WHERE ID IN ({ENTITY.SELECTIONSET})



Example: Open the file on a share (path is stored in column 'IMAGE')

SELECT ID, KG, GSTNR, AREA, IMAGE AS "{ACTION.showFile(filename)}" FROM GST WHERE ID  IN ({ENTITY.SELECTIONSET})



Example: Open workflow

SELECT ID, KG, GSTNR, AREA, 'http://www.myServer.com/GMSC/workflows/?workflow=DEMO&nodeid=1' AS "{ACTION.openWorkflow(url)}" FROM GST WHERE ID IN ({ENTITY.SELECTIONSET})



Example: Open workflow and send element id of row

SELECT ID, KG, 'http://www.smartclient.ch/gmsc/Workflows/?workflow=neophyten&nodeid=22&id=' || NAME_OF_IDFIELD AS "{ACTION.NeoReport(url)}..



Pfeil new.png To the top Pfeil new.png

Change name of action in datagrid

You can also apply you own label to the buttons in the datagrid. Just create a new action based on browse (or any other action) and set a name. The benefit of this is that the datagrid will show the configured name of the action and you can give the user a hint like Open document or show in browser or just view.



Pfeil new.png To the top Pfeil new.png

How to use browseInNativeBrowser in the grid

- Create a new action in the administrator based on browseInNativeBrowser (or any other action) and apply a new short command like browseNative.

- Use this action in the query definition.


Note: For using the interpration type Label, you must use tables in a specified structure in your data warehouse. See Labeling for the structure of the tables.



Language: English