ALLBASE/SQL Reference Manual (36216-90216)

Chapter 12 533
SQL Statements S - Z
SETOPT
The following two SETOPT statements are equivalent.
SETOPT GENERAL HASHSCAN, NO SORTMERGE
SETOPT BEGIN
GENERAL HASHSCAN;
GENERAL NO SORTMERGE;
END
In the following two SELECT statements, an index scan is performed upon the PartNumber
because the PartNumber column is referenced in the ORDER BY and GROUP BY clauses.
SETOPT GENERAL SORTINDEX
SELECT PartNumber, UnitPrice
FROM PurchDB.SupplyPrice
ORDER BY PartNumber, UnitPrice
SELECT PartNumber, AVG (UnitPrice)
FROM PurchDB.SupplyPrice
GROUP BY PartNumber
After the following sequence of statements is executed, all of the modules stored in the
DBEnvironment will use an index scan when accessing tables with indexes. The cex09
module is an exception, however, because it is validated with the DROP SETOPTINFO
keywords. When the cex03 module is copied into the installable module file with the
EXTRACT command, the index scan specified by the SETOPT statement is not included in the
installable module file.
SETOPT GENERAL INDEXSCAN
VALIDATE ALL MODULES
SETOPT CLEAR
VALIDATE DROP SETOPTINFO MODULE cex09
EXTRACT MODULE cex03 NO SETOPTINFO INTO Modfile