SET Statement
The SET statement is used to specify a number of runtime options and has the general format:
SET [NO]option [additional parameters];
The option is set on or active by SET option or SET option ON (depending on the option). It is turned off by a corresponding SET NOOPTION or SET option OFF. Additional parameters are required, depending on the option. For syntax details, see the SQL Reference Guide.
Environment Variables Commonly Used with SET
SET statements are executed as part of query language startup procedures at selected levels of scope. A SET statement is entered directly at a terminal for temporary settings or executed using a Ingres environment variable/logical to establish a default option setting for all users. Several levels are shown in the following table:
Example: Set Statement Entered Directly
One or more set options can be specified using the _SET environment Ingres environment variables and logicals. They can be assigned directly from the operating system shell. Separate multiple SET statements by semicolons (up to a limit of 256 characters), as shown in the following examples:
Windows:
SET ING_SET=set nojournaling;set printqry
UNIX:
C Shell:
setenv ING_SET "set nojournaling; set printqry"
Bourne Shell:
ING_SET = "set nojournaling; set printqry" export ING_SET
VMS:
DEFINE ING_SET "SET NOJOURNALING; SET PRINTQRY"
Example: Set Statements in an Include File
SET statements can also be implemented by means of an INCLUDE statement. The INCLUDE statement allows you to place the SET statements in a file and specify the file name in the setenv (or equivalent) command. Use of the INCLUDE option also avoids the 256-character line limit.
For example:
Windows:
set ING_SET=include c:\extra\ingres\set.ing
UNIX:
C Shell:
setenv ING_SET "include /extra/ingres/set.ing"
Bourne Shell:
ING_SET = "include /extra/ingres/set.ing"
export ING_SET
VMS:
DEFINE ING_SET -"INCLUDE DUA0:[EXTRA.INGRES]SET.ING"
The file set.ing includes the following statements:
set autocommit on;
set lockmode on mastertable
where level = page,
maxlocks = 10;
SET Statements in Startup Files
SET statements are automatically executed as part of query processor start up. Various startup defaults are enabled either by setting a Ingres environment variable/logical (such as ING_SET or II_EMBED_SET described above) or by including these SET statements in one of the query processor startup files.
Last modified date: 08/29/2024