GNA – SQL Query Editor

SQL Query Editor

Overview

The Govern New Administration (GNA) SQL Query Editor allows you to create both Action and Selection SQL queries. Selection queries are used to search and view data, while Action queries allow you to update, or delete data in the database. As with the SQL Query editor in the Govern for Windows Admin, the queries you design are validated for syntax.

What’s New in 6.1

[6.1.1803] Monitoring Tables for Changes (Section below)
[6.1.1506] You can now override queries by year and jurisdiction and specify the context (the business entity where it will be executed). It is now possible to test the queries.

Command Buttons

New – Click New to clear the screen so you can create a new SQL Query.

  • Save – Click Save to save a new query or modifications to an existing one.
  • Delete – Click Delete to remove the current record.

Read More...

SQL Query Editor Parameters

  • Query Name – Enter a name or code to identify the query.

For the queries that retrieve data and display a value, you can add the following characters to the beginning of the name. These characters format the value in the result:

Character Format Type Example
$ Currency with decimals $2,000.25
@ Currency without decimals $2,000
#! Numeric with decimals 2,000.25
. Numeric without decimals 2,000

For example, the following query retrieves the appraised value of the property and formats it as the Currency without decimals type:

Query Name: @GetApp
Query: SELECT appraised_value FROM MA_MASTER WHERE p_id = parcel id and frozen_id = frozen id and year_id = year id
Result: $288,000
  • English Short Description – Enter a short description to identify the department. This is useful for fast data entry and look-ups if space is limited on the forms.
  • English Long Description – Enter a long description to identify the department. This will be displayed for look-ups on forms and will be normally used for reporting.

Second Language Fields

When there is a 2nd language, or multiple languages, ensure that these description fields are also completed.

  • Is System – This flag / option is reserved for constants that are designated as Govern.NET system data.

About System Reserved Values

Only users with Super-User access will be able to select and deselect the Is System option. In addition Super Users can also create new values and flag them for Govern.NET system use.
NOTE: System constants are reserved for use by the Govern.NET system and as such should not be modified or deleted without a full understanding of the implications. Deletions of system values can damage the Govern.NET system, rendering it inoperable. Modifications that are made to System values should always be noted. When a system wide update is performed, these modifications may be overwritten.

  • Warning – Enter a message to be displayed before the query is executed, in this optional field. For example, if you are linking a query to the Delete button of a function, create a message to notify the user that one or more records will be deleted. The user can confirm or cancel the action.
  • Alternate Connection Key – Database connections are usually set in the General Settings form, they can be overridden if required. An alternate Connection Key can be specified.
  • Query (SQL) – Enter the new SQL Query statement or modify an existing one, in this edit box.

Tutorial

Creating Queries

Create a Simple SQL Query

For this example we will create a basic SQL query that will retrieve lot size information froma Govern table (Table: MA_LAND).
The query will need to get the lot size entry under the LOT_SIZE column in the MA_LAND table. The query should look like the following:

SELECT MA_LAND.LOT_SIZE

This means that we need the LOT_SIZE column…

FROM MA_LAND

…from the MA_LAND table…

WHERE MA_LAND.YEAR_ID = Year ID AND MA_LAND.FROZEN_ID = Frozen ID AND MA_LAND.LAND_ID = Land ID

…the YEAR_ID is the same as the current Year ID, the FROZEN_ID is the same as the current Frozen ID, and the LAND_ID is the same as the current Land ID.

To create a simple query…

1. In the GNA ribbon, click the Editors tab: select SQL Query Editor
2. Click Create a New Item to start a new query.
3. Enter LOTSIZE2 in the Query Name field (2)
4. In the Short Description field enter Lot Size (3)
5. Click into the Long Description field (4), the Short Description will be copied into the Long Description, add any additional information to the name.
6. Click in the Query (Sql) field (5); begin typing in the query created earlier.

SELECT MA_LAND.LOT_SIZE FROM MA_LAND
WHERE MA_LAND.YEAR_ID=Year ID AND
MA_LAND.FROZEN_ID=Frozen ID AND
MA_LAND.LAND_ID=Land ID

NOTE: When entering the query, ensure that there are no spaces before and after the “=” sign. For other syntax rules, see SQL Syntax Rules for GNA.

7. To save the new query, click Save (6); if an error exists within the query, the system will not allow it to be saved. You will be presented with a dialog box like the following; click OK and make any necessary corrections to the syntax of the query.
NOTE: To minimize the chances of errors when composing your queries, refer to SQL Syntax Rules for GNA.
The new query will appear under the SQL Definition List (A) on the left hand side.

The query will appear on the left hand side under the SQL Definition List. When saved this query will be accessible for use in formulas and logical expressions.

Query Types

You can compose and store both Action Queries and Selection Queries in the SQL Query Editor. To retrieve or to use a value from the current record; for example, while running a query from a function or formula, you can include a keyword. See Using Keywords for details.
NOTE: Keywords can be included on the SQL Definition Setup form, only; on this form you must use SQL syntax for Microsoft® Access®.

Selection Queries

Selection Queries are used to retrieve records from one or more specified tables, according to the selection criteria.

The syntax is as follows:

SELECT [column] FROM [table] WHERE [criteria]

For example, the following query, retrieves the City District name from the PC_AREA table for the record matching the current parcel ID, frozen ID and year.

SELECT DIST_CITY FROM PC_AREA WHERE p_id=parcel id and frozen_id=frozen id and year_id=year id

Monitoring Tables for Changes

Available in Rel. 6.1.1803
NEW! Observable user queries are user queries where the result is automatically refreshed whenever one of the parameters or the underlying data changes. This is the case for:

  • View queries
  • Calculated fields
  • Lookup lists
  • Etc.

In order to update itself when the underlying data changes we must listen for the table changed event. As long as the table name is in the query, it will be refreshed.
However, when using a View or an Alias instead of the actual table name, then issues will arise as you will not know that the query must be re-executed. In such instances, the table name can be specified explicitly by using the hint monitortables:

–monitortables(NA_NAMES, PC_PARCEL)SELECT *
FROM v_view1 v1 INNER JOIN v_view2 v2 ON v1.na_id=v2.p_id

In the previous example, v_view1 is actually a view over the table NA_NAMES, while v_view2 is a view over PC_PARCEL. By using the hint monitortables users can explicitly define which tables are monitored for changes.

Action Queries

Action Queries are used to perform actions, such as updating records in one or more tables, adding records to a table, deleting records from a table or creating a new table or index.
This section provides simple examples of Update, Append and Delete Queries. Since the SQL Definition Setup form is used for queries that are run multiple times, it is better to compose and run a Create Query from outside Govern.

Update Queries

Update Queries are used to modify records in one or more tables, by changing values in specified tables and fields, according to certain criteria.

The syntax is as follows:

UPDATE table.* SET value WHERE criteria

For example, the following query enters the value abc in the Fire District field of the PC_AREA table, wherever the value for this field is null.

UPDATE pc_area SET dist_fire = ‘abc’ WHERE dist_fire IS NULL

Update Queries are typically used when you need to change multiple records in a table or records in multiple tables.

TIP: You do not obtain a list of results from running this type of query. To verify which records will be changed, you can run a Selection Query
using the same parameters and criteria and view the Results screen.

Insert Queries

Insert Queries are used to add a single record to one or more table. You need to specify the fields to which you are adding values and the value for each field. Otherwise, the default value or Null is entered.

The syntax is as follows:
INSERT INTO table (column list) VALUES (value list)

For example, the following query adds a record to the VT_USR_NAMECODE table, entering the values ENG, LD, ITR and In Trust in the language, department, code, short description fields.

INSERT INTO vt_usr_namecode (language,dept,code,short_desc)
VALUES (‘ENG’,’ ’,’ITR’,’In Trust’)

You can also append multiple records to a table, by first selecting the records in another table. For this, a Selection Query is added to the Append Query.

Delete Queries

Delete Queries are used to remove records from one or more tables.

The syntax is as follows:
DELETE [table.*] WHERE criteria

For example, the following query, add records containing the year 2004 are deleted from the PC_AREA table.

DELETE FROM pc_area WHERE year_id = 2004

TIP: The Delete Query deletes more than the specified fields, it deletes the entire record. To delete data from specific fields only, create an update query that changes the values to Null.

Monitoring Tables

Observable user queries are user queries where the result is automatically refreshed whenever one of the parameters or the underlying data changes. Queries of this sort are used in the following:

  • View Queries
  • Calculated Fields
  • Lookup Lists

and so on…
In the above examples, data changes due to user interaction may occur with the above types of queries. In order to update when the underlying data changes you can “listen” for the table changed event. As long as the table name is in the query, the data will be refreshed. Issues arise when using views
As a view is the result set of a stored query on the data
However, if using a view or an alias instead of the actual table name then we won’t know that the query must be re-executed. In this case you can specify explicitly the table name by using the monitortables hint :

–monitortables(NA_NAMES, PC_PARCEL)SELECT *
FROM v_view1 v1 INNER JOIN v_view2 v2 ON v1.na_id=v2.p_id

In the previous example, v_view1 is actually a view over the table NA_NAMES, while v_view2 is a view over PC_PARCEL. By using the hint monitortables users can explicitly define which tables are monitored for changes.

See Also

Formula Editor

Logical Expression Editor

SQL Syntax Rules for GNA

Query Types

Advanced SQL Queries
Keywords
Best Practices for SQL Queries
Special Cases

100-Queries

 

 

103-ed-004

 

0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this.
Loading...

103-ED-007

External Command Editor version 6.1

Version 6.0 | Version 6.1

Overview

The External Commands Editor is used for opening an external application and passing a parameter from Govern directly to that application. Parameters include Govern attributes, Govern IDs, such as the parcel ID, P_ID, and e-mail addresses. External commands can be linked to the Profile Editor, and added to the Govern Ribbon, or added as a link to a Govern form, through the OFD.

Examples include:

  • Opening Google Maps to a specific address from the Govern Ribbon in the Property Control Profile.
  • Opening a Real Estate application to a specific address from the Sales Information form in Govern.
  • Sending an e-mail to a property owner directly from the Tax Billing form in Govern.
  • Opening a saved map in Google Drive to a specific location from the Govern Ribbon in the Appraisal Profile.

The syntax for these commands is provided under Examples of Commands .
In Govern OpenForms, 6.1, external commands are added through expressions. In version 6.0, the syntax is different and in version 5.1, both the syntax and the setup are different.

Creating a Command

To create a new external command in 6.1:

  1. Launch GNA.
  2. Select Editors > External Commands Editor.
  3. Enter a code in the Code field to uniquely identify the command.The code must start with a letter.
  4. Enter descriptions in the English and French Short and Long Description fields.
  5. Click the ellipsis button beside the Expression field and enter an expression.This is a required field. See the examples for some expressions that can be added.
  6. An icon is displayed with the command in the Govern Ribbon or on the form.
  7. Do one of the following:
    If you are adding the command to the Ribbon, click the ellipsis button beside the Icon field, navigate to the directory where the icon is stored, and select it.
    The icon is saved in the database; so, you do not need to keep a copy of it.A preview of the icon is displayed beside the field.To delete the icon, click Delete beside the field.If you are adding the command to the form, add the icon in the OFD.
  8. Click Save.
  9. Follow the instructions for adding the command to the ribbon or to a form. When the command is added to a form or to the Ribbon, it is displayed in the Used In text box.

 

Examples of Commands

The following example provides the syntax for opening Google Maps to a specific location.
Enter the following expression in the Expression Selector:

cmGglMaps
https://maps.google.com/maps/?q=’+query(‘syMaps‘)
Note: The query must be predefined in the Select Queries Editor in GNA. The query for this expression is:

SELECT ISNULL (PC_ADDRESS.FORMATED_ADDRESS,’aa’) +’ ‘+ ISNULL
(PC_ADDRESS.CITY,”) +’ ‘+ ISNULL
(PC_ADDRESS.ZIP_POSTAL,”), ‘”Map this Location”‘ as Label
FROM PC_ADDRESS INNER JOIN PC_PARCEL ON
PC_PARCEL.P_ID=PC_ADDRESS.P_ID
WHERE PC_PARCEL.P_ID=Parcel ID

Adding an External Command to the Govern Ribbon
External Commands are added to the Govern Ribbon through the Profile Editor in GNA.
To add a command to the Govern Ribbon:

  1. Launch GNA.
  2. Select Editors > Profile Editor.
  3. Select the required Profile.
  4. Select the Links tab.
  5. Click the Add button in the External Commands list box.
  6. Select the command or commands that you want to add from the Select the External Commands window.
  7. Click Save.

The command appears in the Tools menu in the Govern Ribbon for the Profile.

Adding an External Command to a User Form

External commands are added to a Govern user form through the OpenForms Designer, as a link.
To add a command to a Govern form.

  1. Launch the Govern OpenForms Designer (OFD).
  2. Select the Link control from the tree view on the left.
  3. Drag it to the required position on the form. The link is displayed in the selected cell in the OFD Editor.
  4. The Action property is automatically selected and outlined in red. This is a required property.
  5. Configure the properties as described in this section.
  6. Click Save.

Note: The logged-in user must have the required security permissions for the application, form, or batch process. Otherwise, an error message appears.

Defining the Properties for a Link

Select the link on the OFD Editor and modify the properties in the Properties Explorer. When the Link is selected the word Link appears at the top of the Properties Explorer.
Element ID: As with all items, the User Tab Item has an element ID property. This provides reference in the log files.
Layout: Adjust the height and width of the label in the Layout property under Properties.
Display Type: You can display the link in one of the following formats:

  • Hyperlink
  • Button

Action: Select Execute Command from the drop-down list.
Link to: Select the command from the drop-down list.
Icon: Click the ellipsis button and select the icon, you want to add, from a computer or network directory.
The icon is saved to the database. There is no need to retain a copy of it.
Is enabled: Click the ellipsis button to open the Expression Selector. Enter an expression to make the link read-only under certain conditions.
Is visible: Click the ellipsis button to open the Expression Selector. Enter an expression to hide the link under certain conditions.
Expressions evaluate to true or false. You could write False in the Expression Selector to make the link read-only or invisible under all conditions. Alternatively, you could write an expression to do this under certain conditions, such as when another value on the form is equal to a certain amount.
Text: The text entered in this field appears on the form. By default, it reads Link. You can modify this with an expression. Click the ellipsis button to open the Expression Selector.
To display text, you need to enter it inside single quotation marks; for example, ‘Your Text’. You can add other expression syntax to the text in order to make it more specific.
Tooltip: Enter a tooltip, in English, French, or both, to display additional information when the mouse hovers over the link.
The command is launched from a link on the form.

Documentation
For complete details on external commands see:

version 6.1

External Commands, version 6.1

version 6.0

External Commands, version 6.0

version 5.1

External Commands, version 5.1

Information for Govern Users

See also External Command in Govern.

Information for Developers

For Technical Information also refer to govern DEVELOPER’S 101-std-fea-020

Overview | Information for Govern Users | Information for Developers

 

Constant Value Test Case

Constant Value Test Case

6.1 Test Case

Overview

This page will be updated as information becomes available.

 

 

103-ed-003-test

 

 

Standard Report – Batch Execution Audit

Standard Report – Batch Execution Audit

Overview

Details about the Batch Execution Audit – Standard Report will be posted here when it is available.

 

 

101-std-rpt-001-toreview

 

0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this.
Loading...

GNA – Std. Report – Parameters Audit Report

Standard Report – Parameters Audit Report

Overview

This report is available in 6.1 GA 1609.
It provides the audit information of the changes made in Configuration and Parameters.

GNA_Audit.png

GNA_Audit.pdf

 

 

101-std-rpt-003-GNAParametersAudit

 

0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this.
Loading...

101-std-fea-043

Standard Module (STD) – Form Action Button Send Email
Govern Standard Module Overview, Configuration, Installation, OpenForms Reference, What’s New, wiki Module Map … Last modified July 21st, 2017
Version 6.1 (1706)

Table of Contents

Overview

Overview

New standard Action Button feature allows the users of a form to send an email based on a given email template with predefined parameters.
Custom Control Name: SendEmail_Action

  • This action button is securable in OFD
  • There are 5 properties that can be set:
    • AllowOverrideBody: Allows the user to override the body of the message
    • AllowOverrideSubject: Allows the user to override the subject of the message.
    • AllowOverrideTo: Allows the user to override the To of the message.
    • DelayDelivery. If checked, the email will not be sent immediately. It will be marked to be delivered later. Currently NOT AVAILABLE (roadmap)
  • Email Template

For technical details, see Sending emails from a template Technical information

101-std-fea-043-ui-setup.png
Action Button Setup (OpenForms Designer)