Database Access on Oracle

You can access the database by configuring the logon path in the assignment file or when using the ProcScript open command.

Open/Close Support

Both the open and close ProcScript instructions are fully supported.

Logon Path

In the assignment file, specify the driver and database path:

[DRIVERS]
ORA = ConnectorVersion
[PATHS]
$ORA ORA:{Database}|{UserName}|{Password}

In ProcScript, you can use the open statement:

open "{Database}|{UserName}|{Password}","PathName"
  • ConnectorVersion—connector version identifier, for example U7.2.
  • Database—database specification. It can be:
    • An Oracle two-task communication connector supplied with Oracle. For example, the Pipe connector on Unix .
    • An SQL*Net database specification.

    See your Oracle documentation for more information on the syntax of the database specification.

  • User and Password—user and password. You can specify a question mark (?) for either or both, in which case the Uniface Logon form is displayed, allowing you to enter the missing information.

    If both are omitted, Uniface attempts an automatic logon (also known as default logon, or OPS$ logon). This means logging on to Oracle using the operating system user identification. Oracle supports automatic logon on some platforms. Whether Oracle supports automatic logon when using SQL*Net depends on the SQL*Net protocol. See your Oracle documentation for more information.

    Specifying a user name without a password, or specifying a password without a user name is not valid. If you do this, the ORA connector will generate the following error:

    Oracle connector Error [-24]:
    user name without password, or password without user name specified.

    This error also occurs if you enter an empty user name or password when the DBMS Logon form pops up.

Connector Options Affecting Logon Paths

If the disable precompiler connect connector option is set, Uniface only creates independent non-default connections using the OCI, thereby allowing user-defined 3GL to create the default connection with the precompiler interface.

Loss of Connection

The ORA connector returns -9 in $procerror or $status for the following errors:

  • ORA-00028 your session has been killed
  • ORA-03113 end-of-file on communication channel
  • ORA-03114 not connected to ORACLE

Logon Path to Default Database

$ORA = ORA:|scott|tiger

This specifies a logon path to the default database, using the default communication connector. The user is scott and the password is tiger. The mechanism for identifying the default database and default communication connector are specific to the operating system. For example, on Unix, the environment variable TWO_TASK, or the combination of Oracle_HOME and Oracle_SID is used.

See your Oracle documentation for more information.

Logon Path to Default Database with Pipe Connector

$ORA = ORA:P:|scott|tiger

This specifies a logon path to the default database, using the Oracle two-task Pipe connector (Unix).

Logon Path to Default Database with TCP Connector

$ORA = ORA:t:amsterdam:finance|scott|tiger

This specifies a logon path to the finance database on TCP/IP host amsterdam, using the SQL*Net TCP/IP connector.

The syntax is confusing because both Oracle and Uniface use the colon (:) as a special character. In this example, the database specification interpreted by Oracle is t:amsterdam:finance.

The equivalent user ID string with Oracle tools for this example is:

scott/tiger@t:amsterdam:finance

This complicated user ID string shows that it is probably not a good idea to expect the end user to enter database specifications in the DBMS logon form. Define the database specification in the assignment file, or use the Oracle environment variable TWO_TASK. Depending on your operating system, Oracle can also support an alias mechanism to define the database specifications in a configuration file or environment variable.

Logon Path to Default Database with SQL*Net

$ORA = ORA:finance|scott|tiger

This specifies a logon path using SQL*Net. The database specification finance must be defined in an SQL*Net configuration file called TNSNAMES.ORA.

$ORA = ORA:|?|?

This assignment causes Uniface to display the logon form when the path $ORA is referenced. The end user can specify the user name and password but is not allowed to enter a database specification.

$ORA = ORA:||

This assignment is equivalent to not assigning $ORA at all; it specifies an automatic logon to the default database. The logon form will not display, but Uniface attempts an automatic logon to Oracle when Oracle is configured to allow automatic logons.

Related Topics