Section 11
SQL Statements Table
This table stores certain SQL commands and it is accessed by the application
when it needs to process SQL requests. This is used primarily for custom
interfaces where RASWIN is accessing data from another database such
as a utility billing or building permit system. Users should not
normally change the entries in the the table as
incorrect settings can cause unpredictable or inaccurate results.
Each field in the table is listed, along with a short description,
below:
-
COMMAND_NAME
This is the name used to identify a specific set of SQL
statements within the
table. For example, a command name may be something like GET_FASTPOST_ALL_INFO.
-
SEQUENCE_number
Since a SQL statement entry may be longer than the space
available in the
record, the
SEQUENCE_number allows
additional
lines to be added to the table for a given COMMAND_NAME. The
SEQUENCE_number is used to permit the
application to
assemble all of the related commands in a single command into
the proper order.
The values can start with
1 and progress
up to
very large values. Decimals are permitted, so that 1,
1.1, 1.2,
2 and so on,
will be
properly recognized in the proper sequence.
When the full statement is needed, RASWIN will request the
values from the table based on the
command_name
value in the order specified by the
SEQUENCE_number.
-
COMMAND_TEXT
This is the actual text string that defines the SQL command or
text value
comprising the command. For example for the GET_FASTPOST_ALL_INFO command noted above,
the
COMMAND_TEXT is
SELECT * FROM FASTPOST ORDER BY
FASTPOSTKEY.
Rather than hard-code the
COMMAND_TEXT
in the
program, the RASWIN retrieves the text from the table. This way,
should this
command need to be changed at a later time, it is a matter of
just changing the
table data, rather than the program.
In some entries there are replaceable values which are used
by
RASWIN to permit specific records from the database, rather than
all
entries. For example,
SELECT DEPT_NAME FROM DEPTCODES WHERE DEPT_CODE
=
'@DEPTCODE@'
The
@DEPTCODE@ portion of the command is
replaced with the value of the department code being queried ...
so when the
command is executed, what the program does if first retrieve the
basic SQL
statement, then it replaces the @DEPCODE@ with
the actual value..such as
SELECT DEPT_NAME FROM DEPTCODES WHERE DEPT_CODE
=
'FIN'
Notes: Lines in the table that begin with two or more dashes are
ignored. These
are for comment lines that explain what the related command
does.