SSRS – SQL Server Reporting Services

SQL Server Reporting Services (SSRS)

Version 6.0 & 6.1

Overview

SQL Server Reporting Services (SSRS), is a server-based report generation software system from Microsoft™. SSRS is administered via a web interface, and is used to prepare and deliver interactive and printed reports. SSRS is viewed as an alternative to Crystal Reports or any other tools that are used in gathering business intelligence.

 

NOTE: Govern supports SQL Server 2010 to 2014 for SSRS. SSRS 2016/2017 will not work. Database instances can exist in SQL Server 2016 or greater, but SSRS will need to be on a 2012 or 2014 instance. Users should NOT open SSRS 2014 reports with SSRS 2016 and save them. This will result in an error in GNA and Govern. Additional details can be found at the following link on the Microsoft Developers Network (MSDN)

What’s new

SSRS Report Conversion Tool (301-ssrs-util)

How to Install SSRS

Click here to follow the current instructions on how to install SSRS.

Documentation

Refer to the following user guide(s) for setup and configuration information.
301-(man)-SSRS-v5.1.pdf

Configuration

Refer to the “Configuration in the Govern New Administration (GNA)” section in the “Documentation & Standards SSRS” user guide.
This guide explains the configuration of SSRS in Govern.
Click here to see the General Settings Parameters (SY REGISTRY).

Report Parameters

dept Govern IDs: dept
dept_label Govern IDs: dept long description
language Current application culture
year Govern IDs: Year
rpt_county SY_Registry – SectionName: “General”; KeyName: “county”.
rpt_date String.Format(“{0} {1}”, Date.Now.ToShortDateString(), Date.Now.ToLongTimeString())
rpt_default_date Date.Now.ToShortDateString()
rpt_login Govern IDs: User
rpt_logo USR_Registry – SectionName: “govern”; KeyName: “bitmap”. OR SY_Registry – SectionName: “path”; KeyName: “bitmap”.
rpt_name Report Path
rpt_range Report Range Value (Filter on xyz)
rpt_state SY_Registry – SectionName: “General”; KeyName: “state”.
rpt_title Report Display Name
rpt_ub_max_variation SY_Registry – SectionName: “ub parameters”; KeyName: “Max Variation”.
rpt_uid Govern IDs: User
rpt_username GoverNetConfig.OrganizationName
uniform SY_Registry – SectionName: “work_text”; KeyName: “Assessment Equalisation Rate”.
all_int Call ‘ComputeLateChargesAmountsForArSummary(“na_id”)’ method

 

See Also

301-ssrs-util

 

 

301-ssrs

 

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...

SSRS – Changes to Handling of SSRS Reports (301-ssrs-util)

Changes to Behavior of SQL Server Reporting Services (SSRS)

Version 6.1.2206.0142 / 6.1.1811.2019

Overview

The following contains a description of the changes to the behavior of the SSRS feature in Govern

New Features and Changes in Behavior

Parameter Setup Changes

Users should note that parameters are no longer setup in the Reports Parameters screen. This screen will display only the run options that have been configured in GNA.

Possible “Run on” options that can be displayed are as follows:

On Database – Is configured to do not pass any record that is listed in the Govern Dataset Treeview.

On Recordset – Select this option when the SSRS report is to process a set of records. *

On Current Record – Select this option when the SSRS report is to process the current record.*

Changes related to Recordsets

The Recordsets created by the On RecordSet and On Current Record options come from the DataSet Treeview and are saved into the database (Table: USR_SAVED_DATASETS).
These records are grouped by the field SAVED_SET_NAME with a name like: SSRS_REPORT_GUID, where the GUID is a random GUI text generated at runtime.

Since these new recordsets are temporary, they are automatically removed each time a new SSRS report is executed. The criteria for removal is determined by confirming that SAVED_SET_NAME is like SSRS_REPORT_GUID and the field LAST_MODIF_DATE is older than the day before the current execution. For example, if a report execution is done on 08/10/2022, then all reports created before 08/09/2022 will be removed.

Note the following:

  • The Output tab with the report result is no longer displayed for SSRS reports.
  • The report result will be displayed directly on the default browser pointing to the SSRS server that has been configured for Govern.

New Online SSRS Viewer

In the new online SSRS viewer, the end user must perform the following actions to get the Report.

  1. Select/full fill the Report Parameter fields with the desired values for the report.
  2. Click the View Report button.
  3. A preview for the report will be displayed in the bottom.

To download the report, the user must select any of the output formats for the report with a click on the Save button.

To print the report

  1. Click the Print icon.
  2. The report will not be modified and will be copied into the TEMP folder, but in order to execute the report, it will keep looking in the Custom and Standard folders configured in the GNA settings.

 

NOTE: The appearance of the online SSRS screen can vary depending on the SSRS report version installed on the end users server.

This screen will display only the parameters configured as Visible on the report. Hidden parameters are not displayed here and must be configured in GNA under the parameters section in order to map a Govern Id value to them.

Considerations when running an SSRS report

  • At least one Run on option must be selected to run the report.
  • Reports created or edited in Report Builder 3.0 (2014), and the New SSRS Report Builder (2016), are supported and will be executed in Govern.
  • The report must have the SERVER and DATABASE parameters, where the parameters must be configured as:
    • The very first parameters in the report parameters; this because they will be used to configure the datasource.
    • The parameter visibility can be configured as Visible, or Hidden (this is the preferred value).
    • These parameters will be mapped by Govern with the name and database that are to be used to process the report.
    • The DataType must be ‘Text‘.
  • For the options On Recordset and On Current Record,  the report must have a parameter like RECORDSET_{GOVERN_ID} where:
    • {GOVERN_ID} is the Govern ID that will be used to filter the records.
      For example: if the Govern profile that will use the report is configured to use Parcel Ids, then the name for the parameter will be RECORDSET_P_ID.
    • The DataType must be ‘Text‘.
    • The parameter visibility could be configured as Visible, or Hidden (this is the preferred value).
    • A new recordset entry will be created with a dataset name like SSRS_REPORT_{GUID} to store the GovernId, or set of GovernIds that will be used for the operation.
    • These datasets will not be visible to the user in Govern in the Saved Dataset(s) screen.
    • These datasets will be automatically removed from the database after 2 days, upon the next SSRS report execution.
  • The new SSRS report functionality is no longer creating copies in the TEMP folder that is configured in GNA. As a result of this change, it means that the new version is no longer supporting:
    • Add filters on execution time.
    • Display the report output or parameters at govern.

In order to create/add these parameters the SSRS Converter Tool can be used to convert the rdl reports.

See Also

301-ssrs

301-ssrs-util

 

 

301-ssrs-util

 

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...

SSRS – SQL Server Reporting Services Report Conversion Tool

SQL Server Reporting Services Report Conversion Tool

Version 6.1

Overview

The SSRS Report Conversion tool is a Windows application developed to assist, with some minor manipulations, the conversion of a .rdl report for use in the latest versions of Govern and GNA.

User Interface

When initialized, the SSRS Report Conversion Tool displays as a utility window with input and output parameters.

 

SSRS Report Conversion Tool Parameters

Input Folder – Click to manually type in the path to the Input folder. This is the path to a physical folder that must contain at least one .rpt file that is to be converted.

[…] Select Folder – Click the ellipsis button […] to navigate to the required folder.

Output Folder – This non-editable parameter contains the path to the folder that the converted reports will be placed. This is always a folder named Converted that will be located under the Input Folder path.

Recordset – This combo-box is a GovernId that will be used to group records in Govern. This should be the same GovernId that is configured for the Profile that will be using the SSRS report.

Convert – Click Convert to run the conversion process.

Files to process: – The Files to process area will display all reports within the Input Folder. After a click on Convert, the report names with their status will be listed along with an indication as whether files were converted successfully, or if any issues were encountered during the process.

About the Conversion Process

Users should note the following about the conversion process:

  • The original .rdl file will not be modified.
  • The output file will always add the Parameters SERVER, DATABASE.
  • The parameters RECORDSET_{GOVERNID} will be added if the value for RecordSet is not empty.
    • For example, if the selected value is p_id, the parameter to add will be RECORDSET_P_ID.
  • The datasource connection string will be overridden with the following:
    =”Server=”+ Parameters!SERVER.Value +“;Database=” + Parameters!DATABASE.Value
  • The reports generated in the Output folder are the ones that should be submitted/replaced in the SSRS Server Folders.

 

See Also

301-ssrs

301-ssrs-changes

 

 

301-ssrs-util

 

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...

SSRS – How to Install

How to Install SSRS

The following are the steps required to install Microsoft SQL Server Reporting Services. After successful installation you will be able to use SSRS reports in Govern.

Installation Steps

To proceed you will first need to obtain SQL Server Reporting Services from the Microsoft website.

NOTE: Before any installation, ensure that you have Administrator access to the target computer.
  1. Download Microsoft SQL Server Reporting Services from the following URL: https://www.microsoft.com/en-us/download/details.aspx?id=55252
  2. To install SSRS, click on SQLServerReportingServices.exe.
    • At the first screen click Install Reporting Services.
    • Click to select an edition – select Free: Developer or Free: Express).

      OR

    • Accept the License Terms and click Next.
    • At the Install Database Engine option select Install Reporting Services only. Click Next.
    • At the Specify an install location screen, use the default, or select a path. Click Install.
    • SSRS will be installed.

    • When the installation has completed, restart your computer and prepare to install the Report Server Configuration Manager.
  3. After the system restart, open the Report Server Configuration Manager from the Windows menu.

    1. In the Report Server Configuration Manager screen, at the Report Server Connection prompt, select a server name. This should be the server that contains the SSRS installation.
    2. After the server name has been specified, start the server. Click to select the server on the left hand pane of the Report Server Configuration Manager, and on the right-hand side (RHS), click Start.
    3. At the Report Server Database screen, specify the Report Server Database server.
    4. Next select the option to Create a new report server database.

      At the Change Database prompt, click Database Server on the left hand side. Enter the Server Name, Authentication Type, Username, and Password to test your connection.

      In the Change Database screen, click Database then either use the default or select a name.

      Click Credentials to get the prompt, select an Authentication Type, enter a Username, and a Password.

      Summary of the database, click on next if everything is correct

      On Progress and Finish, click Finish to finish the process.

    5. Select Web Service URL and click on the button Apply

    6. Click on the URL link

    7. Select Database and click on the button Apply
    8. Select Web Portal URL and click on the button Apply
    9. Click on the URL link
    10. Create 3 folders (Standard, Custom and Temp)
    11. Manage folder by adding security to everyone
    12. Refresh the Report Server site, you will see 3 folders
    13. Open the port
    14. Setup SSRS in GNA, go to Parameter\General Settings Editor, choose Report as Registry Filter.
  • Authentication Type – Use the windows integrated security
  • Custom Report Path – Set with the folder named “Custom” created in SSRS previously
  • Standard Report Path – Set with the folder named “Standard ” created in SSRS previously
  • Temporary Report Path – Set with the folder named “Temp” created in SSRS previously
  • URL – The Report Server Web service URL from SSRS
  • Use SSRS – Must be checked to be able to see the menu SSRS in GNA
  • User Domain / User ID / User Password – Will be empty (no need to be set)
You will need to install the Report Builder to be able to change/edit SSRS reports. At the moment you will need to install the version 2014 otherwise you may not be able to edit a Report: https://www.microsoft.com/en-us/download/details.aspx?id=42301

 

 

301-ssrs_how-to-install

 

1 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 5 (1 votes, average: 5.00 out of 5)
You need to be a registered member to rate this.
Loading...

GNA – Queries

SQL Syntax Rules for GNA

Release 6.0 | Release 6.1

Govern Data Access Block (DAB)

The Data Access Block or DAB has several functions in the Govern system. One of these functions is to act as the intermediary between the .NET applications and the database. SQL queries that are used by Govern must go through the DAB. While SQL can be flexible with its syntax, due to its many functions, the DAB must be stricter with syntax. In short what may work in SQL, may have to be modified for the DAB. In fact some of the rules that the DAB requires you to follow are good practises for SQL as well.

The following guidelines and examples have been collected to increase your level of success with Govern SQL queries.

Basic SQL Query Guidelines

A. Field in Table is Always on the Left Hand Side

When creating your query statement, the field that you are referencing in the table should always be on the left hand side (LHS), and the Dynamic Search object should always be on the right hand side (RHS).

Read More...

For Example:

In the following SQL statement …

NOT VALID: WHERE @pmnumber_1=PM_MASTER.PM_NUMBER

NOTE: The above statement is valid in SQL, but it will fail in Govern. The Data Access Block (DAB) will not interpret it correctly.

Should be written as…

VALID: WHERE PM_MASTER.PM_NUMBER=@pmnumber_1

B. No Spaces Allowed after Logical Operators

OPERATORS
Symbol Description
= Equal To
<> Not Equal To
> Greater Than
< Less Than
>= Greater Than or Equal To
<= Less Than or Equal To

 

For Example:

NOT VALID: WHERE PC_PARCEL.PID1 > PC_PARCEL.ID2

should be written as…

VALID: WHERE PC_PARCEL.PID1>PC_PARCEL.ID2

C. Space Before and After LIKE Operator

The LIKE pattern matching operator is used to select only rows that are “like” what you specify. When using it ensure that there is a space before and a space after the operator.

For Example:

NOT VALID: WHERE PC_PARCEL.PID1LIKEPC_PARCEL.P_ID

should be written as…

VALID: WHERE PC_PARCEL.PID1 LIKE PC_PARCEL.P_ID

D. Always Specify Tables and Fields in Statements

When writing statements, always specify Tables then Fields (TABLE.FIELD). This applies even in cases where you are referring to a single table and there would be no ambiguity.

For Example:

The following statement…

SELECT NA_ID, INDEX, DESC FROM NA_NAMES WHERE NA_ID=@nanameid_0

is the same as ….

SELECT NA_NAMES.NA_ID, NA_NAMES.INDEX, NA_NAMES.DESC FROM NA_NAMES WHERE NA_NAMES.NA_ID=@nanameid_0

In the first statement we are only specifying the columns in the NA_NAMES table. This would not pose as a problem if we are only dealing with one table. Realistically, we will often have to interact with multiple tables, and many tables have the same column names; this would create an ambiguity. The system would not know which table is being referred to.

Release 6.0

What’s New

Related current changes to the working of Queries in Release 6.0 will be indicated below.

Release 6.1

What’s New

The following are current changes to the working of Queries in Release 6.1.

Nomenclature

As of Release 6.1, it is mandatory that query names must begin with a letter. [Release 6.1.1506.82]

Related Topics

Query Types
Advanced SQL Queries
Keywords
Best Practices for SQL Queries
Special Cases

Code Keyword Description
ar_id Account Receivable ID Unique identification number of the current Account Receivable record
key_counter Activity ID Identification number of the current Activity record
ac_id Aircraft ID Unique identification number of the current Aircraft Excise Tax record
br_id Bankruptcy ID Identification number of the current Bankruptcy record
bt_id Boat ID Unique identification number of the current Boat Excise Tax record
bldg_id Building ID Identification number of the current Building
bldg_seq Building Sequence Sequence number of the current Building
cc_id Cash Collection ID Identification number of the current Cash Collection record
co_id Complaint ID Identification number of the current Complaint record
*date Current Date The Current Date
dept Department The Department code
frozen_id Frozen ID Identification number of the current Frozen record
haz_id Hazard ID Identification number of the current Hazard record
h_id Hearing ID Identification number of the current Hearing record
in_id Inspection ID Identification number of the current Inspection record
land_id Land ID Unique identification number of the current Land
mb_id Misc. Billing ID Identification number of the current Miscellaneous Billing account
misc_id Miscelleaneous ID Identification number of the current Miscellaneous Billing account
mv_id Motor Vehicule ID Identification number of the current Motor Vehicle Account
na_id Name ID Unique identification number of the current Name
of_id Offence ID Unique identification number of the current Offense record
p_id Parcel ID Unique identification number of the current parcel
pm_id Permit ID Unique identification number of the current Building Permit, Electrical Permit, General Permit, Plumbing Permit, Permit to Name, Animal License, Business License, License to Name, Approval, Bond, Decision, Prosecution or Appeal record
pp_id Personal Property ID Identification number of the current Personal Property account
pp_det_id PP Detail ID Unique identification number of the current Personal Property Item
folio_id Project Folio ID Identification number of the current Project Folio
prj_id Project ID Identification number of the current Project record
tax_id Real Estate ID Identification number of the current Real Estate Tax record
sale_id Sale ID Identification number of the current Sale record
st_acct_id Self Reported Tax Acct ID Identification number of the current Self Reported Tax Account record
st_id Self Reported Tax ID Identification number of the current Self Reported Tax record
si_id Site ID Identification number of the current Site
sa_id Special Assessment ID Identification number of the current Special Assessment record
tax_map Tax Map Number Tax Map Number of the current record
usr_id User ID Unique identification number of the current user
ub_id Utility Billing ID Unique identification number of the current Utility Billing account
year_id Year ID Year identification of the current record

 

100-Queries

 

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 – 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...