The following parameters can be used with all relational data adapters: CONVERSION, DBSPACE, DEFDATE, OPTIFTHENELSE, OPTIMIZATION, PASSRECS, and SQLJOIN OUTER. This topic also describe the EXPLAIN parameter that applies to the DB2, DB2 for VM, and Teradata Data Adapters; the ISOLATION parameter that applies to the DB2 and DB2 for VM Data Adapters; the IXSPACE parameter that applies to the DB2, Oracle, and IDMS/SQL Data Adapters; and the OWNERID parameter that applies to the DB2, Teradata, and Oracle Data Adapters. |
In this section: EXPLAIN (DB2, DB2 for VM, Teradata) ISOLATION (DB2 and DB2 for VM) IXSPACE (DB2, IDMS/SQL, Oracle) |
You can use the SET CONVERSION command to alter the length and scale of numeric columns displayed from a SELECT request. That is, you can control the USAGE attribute in the dynamically created Master File.
SQL [sqlengine] SET CONVERSION {RESET|dtype} [RESET|PRECISION {value|MAX}]
where:
nn [mm]
where:
DATA TYPE |
MAX Precision |
INTEGER | 11 |
REAL | 9 |
FLOAT | 20 |
DECIMAL | 33 |
Note:
Within a FOCUS session, you can designate a default storage space for tables you create with the FOCUS CREATE FILE or HOLD FORMAT SQLengine commands. For the duration of the session, the RDBMS places such tables in the DB2 for VM DBSPACE, IDMS/SQL segment.area, Oracle tablespace, or DB2 database you identify in the SET DBSPACE command.
Issue the SET DBSPACE command from the FOCUS command level
SQL [sqlengine] SET DBSPACE storage
where:
The data adapter may have been installed with a default, site-specific, DBSPACE specification. Use the SQL ? query command to display the setting.
Use the SET DEFDATE command to change the value of the default date FOCUS uses for the RDBMS DATE data type. See in Additional Topics, for a complete discussion.
From the FOCUS command line, issue
SQL [sqlengine] SET DEFDATE {NEW|OLD}
where:
If you use the MODIFY facility to maintain RDBMS tables containing DATE columns, a change in the default date from prior releases may impact existing applications. See Additional Topics, for more information.
You can instruct the data adapter to execute an RDBMS EXPLAIN command for the SQL SELECT statements issued by a FOCUS request before it actually issues the FOCUS request. At the FOCUS command level enter
SQL [sqlengine] SET EXPLAIN {OFF|ON [n]}
where:
n
To use the ON setting, you must satisfy all RDBMS requirements for executing an EXPLAIN, such as having EXPLAIN tables in DB2 and DB2 for VM or an XPLTRACE allocation for Teradata. The ON setting applies to TABLE and SQL Passthru SELECT requests only; it is ignored by the MODIFY facility and non-SELECT SQL Passthru requests.
Note: For Teradata, TABLE requests that result in multiple SQL SELECT statements and Direct SQL Passthru requests are not supported with SET EXPLAIN set to ON.
Each RDBMS protects data being read by one user from changes (INSERT, UPDATE, or DELETE) made by others; the isolation level setting governs the duration of the protection. That is, the isolation level determines when shared locks on rows or data pages are released, so that those rows or pages become available for updates by other users. You can dynamically set the isolation level within the FOCUS session using the SET ISOLATION command for DB2 and DB2 for VM. |
How to: |
Note: For IDMS/SQL, see TRANSACTION.
You can change the isolation level by issuing this command in a MODIFY procedure or at the FOCUS command level. (For Maintain, you must issue the command at the FOCUS command level prior to invoking the Maintain procedure.) The setting remains in effect for the FOCUS session or until you reset it.
From the FOCUS command level, issue
SQL [sqlengine] SET ISOLATION level
where:
Note:
To display the isolation level setting, issue the SQL ? query command.
You can override the default parameters for the DB2 or Oracle index space or for the IDMS/ SQL default index segment.area and default index specifications implicitly created by FOCUS CREATE FILE and HOLD FORMAT DB2, SQLORA, or SQLIDMS. The syntax is |
Example: |
SQL [sqlengine] SET IXSPACE [index_spec]
where:
To reset to the default index space parameters, issue the SET IXSPACE command with no operands.
Use the long form of Direct SQL Passthru syntax for commands that exceed one line:
SQL sqlengine
SET IXSPACE index_spec
END
To specify the USING-BLOCK, FREE-BLOCK, and CLUSTER portions of the CREATE INDEX statement for DB2, enter the following:
SQL DB2
SET IXSPACE USING STOGROUP SYSDEFLT PRIQTY 100
SECQTY 20 FREEPAGE 16 PCTFREE 5 CLUSTER
END
To specify the segment.area and INDEX BLOCK portions of the CREATE INDEX statement for IDMS/SQL, enter the following:
SQL SQLIDMS
SET IXSPACE IN EMPSEG.EMPAREA INDEX BLOCK CONTAINS 5 KEYS
END
To specify the Oracle table space ORATS1 for an index:
SQL SQLORA SET IXSPACE TABLESPACE ORATS1
You can use the SQL ? query command to determine the current IXSPACE setting. If the current setting is the default, IXSPACE does not display in the SQL ? output.
When you issue the SET OPTIFTHENELSE command, the data adapter attempts to deliver the construct of FOCUS IF-THEN-ELSE DEFINE fields to the RDBMS as an expression. The DEFINE field must be an object of a selection test or an aggregation request. The DEFINE definition may be specified in the TABLE request or in the Master File.
SQL [sqlengine] SET OPTIFTHENELSE {ON|OFF}
where:
Depending on the OPTIMIZATION setting, the data adapter may generate SQL SELECT statements that allow the RDBMS to perform operations (such as join and aggregation) and return the data to the data adapter for FOCUS report generation (see The Data Adapter Optimizer).
To invoke data adapter optimization, issue the following at the FOCUS command level
SQL [sqlengine] SET {OPTIMIZATION|SQLJOIN} optsetting
where:
You can issue the SET OWNERID command to designate a creator name for all unqualified table names. The data adapter will then use the owner ID as the creator name whenever the Access File does not include a creator value as part of the table name. Direct SQL Passthru requests are not affected by this setting. The syntax is
SQL [sqlengine] SET OWNERID ownerid_value
where:
The data adapter uses the owner ID whenever there is ambiguity about the creator name. For example, the data adapter uses the owner ID as the creator for any table you create using:
If you do not have sufficient rights to create tables using the owner ID you set, an SQL error results and the table is not created.
When this setting is in effect, the following line is added to the output of the SQL ? query:
You can use the SET PASSRECS command to display the number of rows affected by a successfully executed Direct SQL Passthru UPDATE or DELETE command. The syntax is
SQL [sqlengine] SET PASSRECS {OFF|ON}
where:
For example, a DELETE command that executes successfully and affects 20 rows generates the following message:
(FOC1364) ROWS AFFECTED BY PASSTHRU COMMAND: 20/DELETE
In addition to this message, the data adapter updates the FOCUS system variable &RECORDS with the number of rows affected. You can access this variable with Dialogue Manager and display it with the ? STAT query.
Note:
With the SET SQLJOIN OUTER command you can control when the data adapter optimizes outer joins, without affecting the optimization of other operations. (An outer join is generated when the SET ALL=ON command is in effect.) This parameter provides backward compatibility with prior releases of the data adapter and enables you to fine-tune your applications.
When join optimization is in effect, the data adapter generates one SQL SELECT statement that includes every table involved in the join. The RDBMS can then process the join. When join optimization is disabled, the data adapter generates a separate SQL SELECT statement for each table, and FOCUS processes the join.
The syntax is
SQL sqlengine SET SQLJOIN OUTER {ON|OFF}
where:
Note:
The following table describes how different combinations of OPTIMIZATION and SQLJOIN OUTER settings affect data adapter behavior. It assumes that SET ALL = ON:
Settings |
Results |
||
OPTIMIZATION |
SQLJOIN OUTER |
Outer Join Optimized? |
Other Optimization Features |
ON |
ON |
Yes |
Enabled |
ON |
OFF |
No |
Enabled |
OFF |
N/A |
No |
Disabled |
SQL |
ON |
Yes, in all possible cases |
Enabled |
SQL |
OFF |
No |
Enabled |
FOCUS |
ON |
Yes if results are equivalent to FOCUS managed request |
Enabled |
FOCUS |
OFF |
No |
Enabled |
If SQLJOIN OUTER is set to OFF, the following message displays when you issue the SQL ? query command:
Information Builders |