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