Similarly, if you assign a logical name to a database, instead
of its defined name, declare a PHYSICAL attribute to direct
OmniAccess to the database root file.
Defining Tables
In a DBMS where tables are defined, supply the defined name
of a table from the defined database. No other declarations
are required when TABLE is defined as part of a supported
DBMS
Defining COLUMNs
In a DBMS where columns are defined, you should supply the
name of a column from the defined database.
Assembly Rules
You can create virtual columns by specifying SQL assembly
rules in a column statement.
The OMNIDEX environment catalog supports SQL SELECT and SQL
INSERT assembly rules as supported by the native data management
system. You can use these to represent database expressions,
functions, or composite search items. The SQL SELECT rule
determines what data is returned when that column is displayed.
The SQL INSERT rule determines what data is inserted for that
column based on data inserted in other fields for that row.
The following rules apply:
- Both SELECT and INSERT rules may include native database
functions, or any other legal syntax supported by the database.
- Special tokens are supported in these rules which relate
to the database, table and column names. The following tokens
are supported:
%d represents the
database wherever it appears in the rule string.
%t represents the
table wherever it appears in the rule string.
%c represents the
column wherever it appears in the rule string.
- Tokens can appear multiple times in a single assembly
rule. For example:
'%t,%c+(0.05*%t,%c)'
top
Omnidex ROWIDs
If a four-byte integer column in a table contains sequentially
ascending unique values, and there is an index installed on
it, you can use that column as an Omnidex row ID. To declare
a column as an Omnidex row ID, add a USAGE clause after the
DATATYPE. The USAGE clause should contain any of the following
predicates:
ROWID designates
the column as an Omnidex row ID where unique values are assigned
programmatically.
AUTO ROWID designates
the column as an Omnidex row ID where unique values are assigned
by the native data management platform.
The LENGTH of the
column must be declared as LENGTH 4.
The example below shows the CUST_NO column being designated
as an Omnidex row ID whose value is programmatically assigned
by the RDBMS whenever a new record is added to the table:
COLUMN CUST_NO DATATYPE INTEGER USAGE ROWID LENGTH
4
If the Omnidex row ID value is automatically assigned by
the native RDBMS, the column definition should look like this:
COLUMN CUST_NO DATATYPE INTEGER USAGE AUTO ROWID
LENGTH 4
top
Defining User Access
If the DBMS requires a user name and password to access tables,
you must also declare a USERCLASS. By associating a user class
named "DEFAULT" with a USER name and PASSWORD, USERCLASS
declares the type of access that all users of the environment
catalog have to its database. The USER name and PASSWORD declared
in the USERCLASS statement are used to open the declared DATABASE
after successfully connecting to the OMNIDEX environment catalog.
You can override the access defined in the environment catalog
by calling oaconnect with the DBUSER option.
top
|