Parameters That Apply to Oracle Only

This section describes the Oracle Data Adapter SET CONNECTION_ATTRIBUTES, SET DEFAULT_CONNECTION, SET FETCHSIZE, SET INSERTSIZE, SET ORANUMBER and SET SPMAXPRM commands.

In this section:

Oracle CONNECTION_ATTRIBUTES

DEFAULT_CONNECTION

FETCHSIZE

INSERTSIZE

ORACHAR

ORANUMBER

SPMAXPRM


Top of page

Oracle CONNECTION_ATTRIBUTES

The SET CONNECTION_ATTRIBUTES command allows you to declare a connection to one Oracle database server and to supply authentication attributes necessary to connect to the server.

You can connect to more than one Oracle database server by issuing multiple SET CONNECTION_ATTRIBUTES commands. The actual connection takes place when the first request referencing that connection is issued. You can issue SET CONNECTION_ATTRIBUTES commands in a FOCEXEC, at the FOCUS command prompt or in a FOCUS-supported profile. The profile can be encrypted.

If you issue multiple SET CONNECTION_ATTRIBUTES commands:

The data adapter supports connections to:

Once you are connected to an Oracle database server, that server may define Oracle DATABASE LINKs that can be used to access Oracle tables on other Oracle database servers.

If needed, the DBA or some other authorized person at your site will supply you with a valid Oracle user ID and password.

It may be desirable to prompt users for their Oracle password instead of coding it in a procedure. In this case, use a Dialogue Manager variable in its place, and retrieve the value using -CRTFORM or -PROMPT facilities. If you use -CRTFORM, you can make the password field non-displayable for additional security.

A valid Oracle user ID and password must be supplied before issuing commands that access the Oracle RDBMS. If a valid Oracle login ID and password have not been supplied, an error message is returned. You should respond by correcting and re-issuing the SET CONNECTION_ATTRIBUTES command.

The SET CONNECTION_ATTRIBUTES command stores both the Oracle login ID and password in user virtual storage; it does not immediately initiate a login to Oracle. The actual login is deferred until a subsequent command is issued that requires the services of the Oracle RDBMS.

The syntax is:

SQL [SQLORA] SET CONNECTION_ATTRIBUTES [connection_name]/userid,password

where:

SQLORA
Indicates the Oracle Data Adapter. You can omit this value if you previously issued the SET SQLENGINE command.

connection_name
Specifies a remote instance using an Oracle TNSNAME (the net service name used as a connect descriptor to an Oracle database server across the network). If omitted, the local database server will be set as the default.

userid
Is the primary authorization ID by which you are known to Oracle, up to 30 characters in length.

password
Is the password associated with the user ID, up to 30 characters in length.

Note: SET USER is a synonym for SET CONNECTION_ATTRIBUTES, supported for compatibility with earlier releases of the data adapter. However, note that the symbol used for separating the connection attribute from the authentication information and the symbol used for separating the user ID from the password have changed in FOCUS 7.2.

Issue the following query command to list status information for all declared connections:

SQL SQLORA ? SERVERS

Top of page

DEFAULT_CONNECTION

Once all Oracle database servers to be accessed have been declared using the SET CONNECTION_ATTRIBUTES command, you can select a default server using the SET DEFAULT_CONNECTION command. If you do not issue this command, the tnsname value specified in the first SET CONNECTION_ATTRIBUTES command is used.

SQL [SQLORA] SET DEFAULT_CONNECTION [connection_name]

where:

SQLORA
Indicates the Oracle Data Adapter. You can omit this value if you previously issued the SET SQLENGINE command.

connection_name
Is the net service name used as a connect descriptor to an Oracle database server across the network. If omitted, then the local database server will be set as the default. If this name has not been previously declared in a SET CONNECTION_ATTRIBUTES command, message FOC1671 is issued.

Note:


Top of page

FETCHSIZE

The Oracle Data Adapter supports array retrieval from result sets produced by executing SELECT queries or stored procedures. This technique substantially reduces network traffic and CPU utilization.

High FETCHSIZE values increase the efficiency of requests involving many rows, at the cost of higher virtual storage requirements. The default value is 20; a value higher than 100 is not recommended because the increased efficiency it would provide is generally negligible.

The block size for a SELECT request applies to TABLE FILE requests, MODIFY requests, MATCH requests, and DIRECT SQL SELECT statements.

SQL [SQLORA] SET FETCHSIZE n

where:

SQLORA
Indicates the Oracle Data Adapter. You can omit this value if you previously issued the SET SQLENGINE command.

n
Is the number of rows to be retrieved at once using array retrieval techniques. Accepted values are 1 to 5000. The default is 20.


Top of page

INSERTSIZE

The Oracle Data Adapter supports buffered insertion of rows into Oracle tables. This technique substantially reduces network traffic and CPU utilization.

High INSERTSIZE values increase the efficiency of requests involving many rows, at the cost of higher virtual storage requirements. A value higher than 100 is not recommended because the increased efficiency it would provide is generally negligible.

SQL [SQLORA] SET INSERTSIZE n

where:

SQLORA
Indicates the Oracle Data Adapter. You can omit this value if you previously issued the SET SQLENGINE command.

n
Is the number of rows to be transmitted to the RDBMS at once. Accepted values are 1 to 5000. The default is 1.

Note: The INSERTSIZE parameter is only functional for consecutive executions of INSERT statements that are identical to each other (except for the values to be inserted). No other intervening SQL statements are allowed, including COMMIT WORK. If a statement is issued that in any way (other than the inserted values) differs from the current blocked INSERT statement in effect, the block is immediately transmitted to the RDBMS, even if the buffer is not full. This restriction has several ramifications:


Top of page

ORACHAR

With regard to CHAR and VARCHAR2 data types, special attention must be paid to which of the two will be used. When you compare a column of CHAR data type to a column of VARCHAR2 data type, where the only difference in data is the additional space in the column of the CHAR data type, Oracle recognizes that the data types are not the same.

The ORACHAR setting lets you specify which of the two data types will be used for inserting, updating, and retrieving data.

If you create the tables outside of FOCUS, we recommend that you use either CHAR or VARCHAR2 data types, but not both. If you create a table with both data types, you might not be able to retrieve the data you inserted due to Oracle's comparison mechanism.

If you use FOCUS to generate Oracle tables and retrieve data, you will not encounter this problem, since the data type being used will be either CHAR or VARCHAR2, depending upon the ORACHAR setting.

SQL [SQLORA] SET ORACHAR {FIX|VAR}

where:

FIX
Uses the CHAR data type.

VAR
Uses the VARCHAR2 data type. This is the default.

Note: Omit the SQLORA target RDBMS qualifier if you issued the SET SQLENGINE = SQLORA command.

Prior to Oracle V7, the Oracle RDBMS treated all character strings transmitted by the data adapter through SQL variables as variable length because all Oracle RDBMS character data types were essentially variable length. In Oracle V7, the CHAR data type was enhanced to possess fixed length characteristics similar to other relational database CHAR data types.

Important: The FIX setting may cause compatibility problems in applications developed in earlier releases of FOCUS or Oracle or under the default setting of VAR. Use of the FIX setting with Oracle V7 CHAR columns in MODIFY MATCH, INCLUDE, UPDATE and DELETE commands, as variables in parameterized Direct SQL Passthru statements, and as cross referenced fields in non-optimized join requests should be tested extensively to verify that their behavior is as expected.


Top of page

ORANUMBER

The ORANUMBER setting determines how the Oracle NUMBER data type will be described in the Master File generated for the answer set returned by a Direct SQL Passthru SELECT request.

By default a NUMBER data type whose precision is:

You can use the ORANUMBER setting to override the default mapping of a NUMBER data type with precision between 32 and 38.


Top of page

Syntax: How to Override the Precision of the Oracle NUMBER Data Type

SQL [SQLORA] SET ORANUMBER {COMPAT|DECIMAL}

where:

SQLORA
Indicates the Oracle Data Adapter. You can omit this value if you previously issued the SET SQLENGINE command.

COMPAT
Indicates that the NUMBER data type with precision between 32 and 37 will be mapped to format D20.2.This is the default.

DECIMAL
Indicates that the NUMBER data type with precision between 32 and 37 will be mapped to format P33.2.


Top of page

SPMAXPRM

An Oracle Data Adapter parameter can be used to set the maximum number of input parameters for stored procedures.

SQL [SQLORA] SET SPMAXPRM value

where:

value
Is a numeric value indicating the maximum number of input parameters that may be entered for stored procedures. The default value is 256. This value is displayed by the SQL SQLORA ? query.

Note: Omit the SQLORA target RDBMS qualifier if you issued the SET SQLENGINE = SQLORA command.


Information Builders