Chapter 21. IMS Remote Database Services 411
case-sensitive. These keywords are a subset of all SQL keywords. IMS JDBC interface
supports the following functions:
ALL
AND
AS
ASC
AVG
COUNT
DELETE
DESC
DISTINCT
FROM
GROUP BY
INSERT
INTO
MAX
MIN
OR
ORDER BY
SELECT
SET
SUM
UPDATE
VALUES
WHERE
21.2.5 IMS Java SQL usage
In this section, we focus on the difference between IMS Java SQL grammar and standard
SQL grammar. We summarize the important SQL usage of the IMS JDBC interface and
provide some SQL samples to help you understand how to use it. For more information about
SQL usage, see IMS Version 9: IMS Java Guide and Reference, SC18-7821.
Sample tables for this section
Figure 21-6 on page 412 shows the sample tables for this section. We assume that SQL
samples are issued against the CustomerTable and OrderTable shown in the figure. The
CustomerTable is made up of the root segments and has the primary key field CustomerNo.
The OrderTable is made up of the dependent segments of the root and has the primary key
field OrderNo and foreign key filed, which comes from the root segment. All segment (table)
names and field (column) names are defined as different Java aliases from the original DBD
definitions.
Important: You cannot use any SQL keywords as Java aliases for PCBs, fields, or
segments. For example, if you have the segment name UNION in the DBD statement, you
have to define explicitly a different Java alias such as UnionTable by using DL/I model
utility function. Note that the SQL UNION function is currently not supported by the IMS
JDBC interface, but any use of SQL keywords for Java aliases are banned in the IMS Java
environment. For a complete list of SQL keywords, see IMS Version 9: IMS Java Guide and
Reference, SC18-7821.