-    DYNAMIC TABLE NAMES    

Dynamically assigning physical tablenames in Oracle

Even though the Uniface architecture does not normally allow the physical name of a logical table to be defined after the application startup, you now can using the UD8 Driver 1.20 and your favourite database.

This feature is known as a driver wrapper, or the 'become' feature. March Hare developed it so that commercial Uniface drivers can have their functionality modified at run time (most often for the support of legacy systems). Most of these changes require modifications to the source code (which every copy of UD8/CSV Driver comes with).

However, we decided to build one feature in that every developer could access 'out of the box'. This demonstrates the flexibility you can add to the drivers.

This is the dynamic tablenames feature. In the same way that you set a dynamic filename for your CSV file, you can dynamically set the physical name of an Oracle table.

How you set filenames / tablenames

Uniface developer may communicate with the driver at run-time using the SQL proc instruction. Any 'parameter' specified in in the help file for USYS$UD8_PARAMS may be sent to the driver, or a 'tablename' string may be sent. eg:

sql ":logical_table:obsolete:new_table","$ud8"

The 3 fields are:

This command will have NO EFFECT on tables that are already opened. So it is best to use this command BEFORE the first retrieve or store on the table, or alternatively, close the path first, eg:

close "$ud8"
sql ":person:obsolete:client","$ud8"

How to wrap an Oracle driver

In this example we will wrap the Oracle driver from Uniface 7.2.05. The UD8/CSV driver may wrap ONE driver. The driver that is being wrapped MUST be specified in the USYS$UD8_PARAMS setting in the assignment file, eg:

[DRIVER_SETTINGS]
USYS$UD8_PARAMS=become ORA ora8141l

The first time you 'log on' to the UD8 driver it will open in UD8/CSV mode. When you close the path and re-open it (logoff/logon), it will open in ORA mode, and all requests will be passed to the ORACLE driver, except that tablenames can be re-mapped.

The next time you close and re-open the path, the driver will then be in UD8/CSV mode, and so it will stay until given a command to 'become ORA' again.

An example

This example we rename the logical table 'PERSON', to the physical table 'CLIENT", eg:

open "","$UD8" ; driver now open in CSV mode
close "$UD8"
; drvier opening in ORA mode
open "ntsrvr01|arthurb|password","$UD8"
sql ":person:obsolete:client","$ud8"
; even though we retrieve person, the table
; client is retrieved
retrieve/e "person"

- UD8/CSV driver is available for all Uniface supported platforms

$Revision: 1.7 $ $Date: 2011/02/28 02:56:32 $[go to top]