Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
oaenv:home [2009/12/07 18:23]
tdo
oaenv:home [2012/10/26 14:24] (current)
Line 3: Line 3:
 ====== OMNIDEX Environment Catalog Syntax ====== ====== OMNIDEX Environment Catalog Syntax ======
 The Omnidex Environment Catalog is the starting point for constructing an Omnidex application. It is the primary source of information used by Omnidex to access a database and the Omnidex indexes. The Omnidex Environment Catalog is the starting point for constructing an Omnidex application. It is the primary source of information used by Omnidex to access a database and the Omnidex indexes.
 +
 +  * [[oaenv:​examples:​home | Sample Environment Catalogs]]
  
 An Environment Catalog is a collection of information,​ objects that include descriptions of databases, tables, columns and indexes, as well as Omnidex specific information like optimization options and configuration details. Omnidex uses this information to determine how to access the databases. It can also store supplemental information about the databases, that can enhance Omnidex'​s ability to optimize queries. An Environment Catalog is a collection of information,​ objects that include descriptions of databases, tables, columns and indexes, as well as Omnidex specific information like optimization options and configuration details. Omnidex uses this information to determine how to access the databases. It can also store supplemental information about the databases, that can enhance Omnidex'​s ability to optimize queries.
Line 11: Line 13:
  
 In the case of flat-file databases, the Environment Catalog plays a special role. Since plain flat-files rarely have meta-data stored in them, Omnidex acts as the database management system, using the Environment Catalog to describe the tables and columns and their relationships to each other, there by allowing standard SQL, ODBC and JDBC access to the data. In the case of flat-file databases, the Environment Catalog plays a special role. Since plain flat-files rarely have meta-data stored in them, Omnidex acts as the database management system, using the Environment Catalog to describe the tables and columns and their relationships to each other, there by allowing standard SQL, ODBC and JDBC access to the data.
 +
 ===== Create an Environment Catalog ===== ===== Create an Environment Catalog =====
 An Omnidex Environment begins as an environment source file, a text file containing all the environment definitions,​ then is compiled into a binary file, the Environment Catalog used by Omnidex. An Omnidex Environment begins as an environment source file, a text file containing all the environment definitions,​ then is compiled into a binary file, the Environment Catalog used by Omnidex.
Line 35: Line 38:
 <​code>​ <​code>​
 Environment start_env Environment start_env
- 
 Database start Database start
- +  ​Type flatfile
-Type flatfile +
 table sales_facts table sales_facts
- +  ​column odx_seq_ID datatype INTEGER 
-column odx_seq_ID datatype INTEGER +  column acct datatype CHAR(10) 
- +  column amount datatype INTEGER
-column acct datatype CHAR(10) +
- +
-column amount datatype INTEGER+
 </​code>​ </​code>​
 ===== Syntax ===== ===== Syntax =====
Line 78: Line 75:
  
 Optional. This is a string of up to 32 characters that defines a version number for the Environment file. VERSION is used for informational purposes only. It in no way affects the application or how Omnidex behaves against the environment. Optional. This is a string of up to 32 characters that defines a version number for the Environment file. VERSION is used for informational purposes only. It in no way affects the application or how Omnidex behaves against the environment.
- 
-  
  
 ==== TITLE "​string"​ ==== ==== TITLE "​string"​ ====
  
 Optional. This is a string of up to 80 characters that describes the Environment file. TITLE is used for informational purposes only. It in no way affects the application or how Omnidex behaves against the environment. Optional. This is a string of up to 80 characters that describes the Environment file. TITLE is used for informational purposes only. It in no way affects the application or how Omnidex behaves against the environment.
- 
-  
  
 ==== SET ==== ==== SET ====
Line 101: Line 94:
  
 # (pound sign) any ASCII digit # (pound sign) any ASCII digit
- 
-  
  
 == OMNIDEX SENTINEL character. == == OMNIDEX SENTINEL character. ==
  
 Default % (percent sign). Default % (percent sign).
- 
-  
  
 == OPTIMIZATION == == OPTIMIZATION ==
Line 116: Line 105:
  
 SET OPTIMIZATION="​AGGREGATION,​ SERIAL"​ SET OPTIMIZATION="​AGGREGATION,​ SERIAL"​
- 
-  
  
 == ESCAPE character == == ESCAPE character ==
  
 Default \ (backslash). Only a single escape character can be defined. Default \ (backslash). Only a single escape character can be defined.
- 
-  
  
 == SQL_SYNTAX {OMNIDEX | OMNIDEX_PLUS} == == SQL_SYNTAX {OMNIDEX | OMNIDEX_PLUS} ==
- 
-  
  
 == CENTURY THRESHOLD n == == CENTURY THRESHOLD n ==
Line 133: Line 116:
 Specifies the year cutoff for determining the century in 2 digit years. For example, if the century threshold is set to 60, a 2 digit year of 45 would be translated to 2045 and a 2 digit year of 61 would be translated to 1961. This setting can be explicitly over-ridden for a specific column in the column definition. Specifies the year cutoff for determining the century in 2 digit years. For example, if the century threshold is set to 60, a 2 digit year of 45 would be translated to 2045 and a 2 digit year of 61 would be translated to 1961. This setting can be explicitly over-ridden for a specific column in the column definition.
 Environment name is a required string of up to 32 characters. Environment name can contain numbers and any of the allowed special characters. However, it MUST BEGIN WITH A LETTER, A-Z (case insensitive). Environment name is a required string of up to 32 characters. Environment name can contain numbers and any of the allowed special characters. However, it MUST BEGIN WITH A LETTER, A-Z (case insensitive).
 +
 ===== DATABASE ===== ===== DATABASE =====
   [DATABASE database_name   [DATABASE database_name
Line 156: Line 140:
  
 If database_name contains any reserved words or allowed special characters, it must be enclosed in single or double quotes. If database_name contains any reserved words or allowed special characters, it must be enclosed in single or double quotes.
- 
-  
  
 == TYPE database_type_spec == == TYPE database_type_spec ==
Line 170: Line 152:
 INFORMIX INFORMIX
    
- 
 == SUBTYPE database_subtype_spec == == SUBTYPE database_subtype_spec ==
  
Line 184: Line 165:
  
 Required in ORACLE and optional in other databases. This is a quoted string of up to 255 characters that declares the version of the DBMS. It is used primarily with relational databases. Required in ORACLE and optional in other databases. This is a quoted string of up to 255 characters that declares the version of the DBMS. It is used primarily with relational databases.
- 
-  
  
 == PHYSICAL "​string"​ == == PHYSICAL "​string"​ ==
Line 192: Line 171:
  
 string is a quoted string that may vary according to database type. See the appropriate database type for details on the PHYSICAL clause. string is a quoted string that may vary according to database type. See the appropriate database type for details on the PHYSICAL clause.
- 
-  
  
 == OPTIONS "​options"​ == == OPTIONS "​options"​ ==
  
 Optional. Optional.
- 
-  
  
 == INDEXPREFIX "​filespec"​ == == INDEXPREFIX "​filespec"​ ==
Line 208: Line 183:
  
 Indexprefix is not used with TurboIMAGE databases, as the database name determines the index prefix and the group and account in the physicals indicates the index location. Indexprefix is not used with TurboIMAGE databases, as the database name determines the index prefix and the group and account in the physicals indicates the index location.
- 
-  
  
 == USERCLASS "​DEFAULT"​ [USER "​username"​] [PASSWORD "​password"​] == == USERCLASS "​DEFAULT"​ [USER "​username"​] [PASSWORD "​password"​] ==
  
 A Required clause for ORACLE and TurboIMAGE (if the TurboIMAGE database is password secured) and optional for INFORMIX. It declares either or both the name and password of a valid database. All connections to the database will connect with this option. username and password can be filespecs where the contents of the file contain the username and password. A Required clause for ORACLE and TurboIMAGE (if the TurboIMAGE database is password secured) and optional for INFORMIX. It declares either or both the name and password of a valid database. All connections to the database will connect with this option. username and password can be filespecs where the contents of the file contain the username and password.
- 
-  
  
 == AUTOPSEUDOCOLUMNS == == AUTOPSEUDOCOLUMNS ==
  
 Automatically constructs pseudocolumns from MDK composite keys. Automatically constructs pseudocolumns from MDK composite keys.
- 
-  
- 
-  
- 
-  
  
 == INDEXMAINTENANCE {DBMS | API} == == INDEXMAINTENANCE {DBMS | API} ==
Line 237: Line 202:
 This setting applies to the entire index installation on this database. It can be over-ridden on a table-by-table basis by explicitly defining the indexmaintenance setting on an individual table. This setting applies to the entire index installation on this database. It can be over-ridden on a table-by-table basis by explicitly defining the indexmaintenance setting on an individual table.
  
-  
 ===== TABLE ===== ===== TABLE =====
   TABLE < tablename | "​tablename"​ >   TABLE < tablename | "​tablename"​ >
Line 252: Line 216:
       < COLUMN [ FROM ]column_spec [ COLUMN column_spec ... > ]       < COLUMN [ FROM ]column_spec [ COLUMN column_spec ... > ]
  
 +== TABLE table_name ==
  
 +table_name
 +
 +table_name represents a non-ambiguous table or view name. table_name must be unique within the database statement but can be ambiguous within the environment. However, any reference to an ambiguous table_name in an application will have to be qualified by the database name: database_name.table_name
 +
 +table_name MUST BEGIN WITH A LETTER, A-Z (case insensitive),​ and may contain up to 32 characters including letters, numbers and allowed special characters.
 +
 +If table_name contains any reserved words or allowed special characters, it must be enclosed in single or double quotes.
 +
 +== TYPE table_type_spec ==
 +
 +TYPE is set according to the DATABASE TYPE declared.
 +
 +One of the following:
 +
 +[{CACHED | DYNAMIC}] VIEW
 +OST (Flat Files)
 +TDF (Flat Files)
 +RELATIONAL (SQL-Class databases only)
 +
 +== PHYSICAL "​filespec"​ ==
 +
 +Optional. filespec is a quoted string, unlimited in length, and can contain an unlimited number of comma separated file specifications,​ including file names and appropriate path and password information as well as any operating system command that outputs a valid physical file name entry. However, each individual file specification is limited to 255 characters in length. See File Name Handling for more details.
 +
 +== OPTIONS "​options"​ ==
 +
 +Options apply to TDF (tab-delimited file) tables only. Multiple options are space separated. The entire option string is enclosed in quotes. Valid options are:
 +
 +COLUMN='​string'​ - Defines the column delimiter.
 +
 +RECORD='​string'​ - Defines the record delimiter.
 +
 +QUOTES - Instructs OA to support quotes in a record. If omitted, quotes are not supported. Note that this option does not cause OA to create TDF files with quotes. It is strictly to support quotes in existing files.
 +
 +ESCAPE='​character'​ - Defines an escape character used to escape delimiters and quotes.
 +
 +options "​column='​\t'​ record='​\r\n'"​
 +
 +== CARDINALITY n ==
 +
 +The cardinality of a table is the number of records in the table. This number should be near the actual table cardinality. Omnidex uses this number to better optimize some queries.
 +
 +== INDEXMAINTENANCE {DBMS | API} ==
 +
 +Optional. Default is API. Specify how Omnidex indexes will be updated.
 +
 +API - The indexes will be updated by Omnidex automatically as the database data is updated.
 +
 +DBMS - The indexes will be updated by some other means, ODXAIM for example, in a separated process.
 +
 +This setting overrides the indexmaintenance definition in the database section.
 +
 +== [{PARENT / PRIMARY} [{KEY / CONSTRAINT}] column_spec] ==
 +
 +[{CHILD / FOREIGN} [{KEY / CONSTRAINT}] column_spec]
 +Optional. The column_spec is the column name or a column specification qualified by a table name. keytype declares any of the following values:
 +
 +PARENT or PRIMARY
 +CHILD or FOREIGN
 +
 +Foreign keys use a REFERENCES clause to relate the child to a parent table by a previously declared primary constraint. Example:
 +
 +FOREIGN CUSTOMER_NO REFERENCES
 +CUSTOMERS(CUSTOMER_NO)
 +
 +- or -
 +
 +CHILD KEY CUSTOMER_NO REFERENCES
 +CUSTOMERS(CUSTOMER_NO)
 +
 +Primary keys and foreign keys can be declared for the same table. ​
 +Multiple column constraints are not presently supported. ​
 +Omnidex does not enforce constraints. Constraint enforcement is left up to the DBMS. Therefore, constraints on flat file databases are not enforced.
 +
 +== AS "​sql_statement"​ ==
 +
 +AS defines a table as a UNION VIEW. Data from other physical tables in the database is unioned together using SQL select statements. The other physical tables must also be defined in the environment file.
 +
 +The column definitions for the view must match the original physical tables exactly. Therefore, the COLUMNS FROM "​table"​ column definition should be used, as opposed to explicitly defining each column in the view.
 ===== Column Specification ===== ===== Column Specification =====
   COLUMN column-name DATATYPE datatype-spec ​   COLUMN column-name DATATYPE datatype-spec ​
Line 265: Line 308:
       [EXCLUDED_TAGS '​options'​]       [EXCLUDED_TAGS '​options'​]
       {AS < columnspec | "​$retrieve_file(FILENAME)"​ > ]       {AS < columnspec | "​$retrieve_file(FILENAME)"​ > ]
 +
 +  COLUMN column_name
 +     ​[INTERNAL]
 +     ​DATATYPE datatype_spec
 +     ​LENGTH n
 +     ​[SCALE n]
 +     ​[PRECISION n]
 +     ​[FORMAT format_spec]
 +     ​[PHYSICAL "​native_column_name"​]
 +     ​[USAGE usage_spec]
 +     ​[CENTURY THRESHOLD n]
 +     ​[OMNIDEX
 +     ​[DATATYPE datatype_spec]
 +     ​[LENGTH n]
 +     ​[FORMAT format_spec]
 +     [AS select_item]
 +        [SQL SELECT "​string"​]
 +     ​[PROMPT "​string"​]
 +     ​[HEADING "​string"​]
 +     ​[LABEL "​string"​]
 +     ​[CARDINALITY n]
 +
 +== COLUMN column_name ==
 +
 +  [[[environment_name.]database_name.]table_name.]column_name[(start,​ length)]
 +
 +column_name represents a non-ambiguous column or portion of a column.
 +
 +column_name MUST BEGIN WITH A LETTER, A-Z (case insensitive) and may contain up to 32 characters including letters, numbers and allowed special characters.
 +
 +If column_name contains any reserved words or allowed special characters, it must be enclosed in single or double quotes.
 +
 +start is the starting byte within column relative to one.
 +
 +length is the number of characters after the starting byte to include.
 +
 +== PROXIMITY ==
 +
 +  SPACE=proximity_spec
 +  NEAR=proximity_spec
 +  BEFORE=proximity_spec
 +  PHRASE=proximity_spec
 +
 +  “proximity_spec” is:
 +     ​NEAR(n) – means insure that word1 is within n words before or after word2.
 +     ​BEFORE(n) – means insure that word1 is within n words before word2
 +     ​PHRASE ​ - means insure that word1 immediately before word 2, and treat as a phrase rather than separate words.
 +
 +The default behavior is as follows:
 +    SPACE=NEAR(999)
 +    NEAR=NEAR(10)
 +    BEFORE=BEFORE(10)
 +    PHRASE=PHRASE ​
 +
 +== INTERNAL ==
 +
 +The INTERNAL section is Required, however the keyword INTERNAL is optional. It is a section identifier for the INTERNAL section of the COLUMN definition. INTERNAL refers to the actual data as it is stored in the DBMS.
 +
 +Use of the keyword when also using an Omnidex section improves the readability of the Environment Catalog source code.
 +
 +==== DATATYPE datatype_spec ====
 +
 +Required. Declares the data type format of the defined column. The DATATYPE keyword is required. See Supported Datatypes for a list of supported datatypes.
 +
 +Binary Datatypes
 +
 +For integer and floating point datatypes, new datatypes have been added that imply a particular length, eliminating the need to express the number of bytes. ​ The new datatypes that have been added are:
 +
 +[SIGNED] TINYINT Binary data stored in one byte, from -128 to 127.  This is equivalent to a “datatype [SIGNED] INTEGER length 1”.
 +
 +UNSIGNED TINYINT Binary data stored in one byte, from 0 to 255.  This is equivalent to a “datatype UNSIGNED INTEGER length 1”.
 +
 +[SIGNED] SMALLINT Binary data stored in 2 bytes, from -32768 to 32767. ​ This is equivalent to a “datatype [SIGNED] INTEGER length 2”.
 +
 +UNSIGNED SMALLINT Binary data stored in 2 bytes, from 0 to 65535. ​ This is equivalent to a “datatype UNSIGNED INTEGER length 2”.
 +
 +[SIGNED] BIGINT Binary data stored in 8 bytes, from (2^63 * -1) to (2^63 – 1).  This is equivalent to a “datatype [SIGNED] INTEGER length 8”.
 +
 +UNSIGNED BIGINT Binary data stored in 8 bytes, from 0 to (2^64 – 1).  This is equivalent to a “datatype UNSIGNED INTEGER length 8”.
 +
 +DOUBLE Double-precision floating point data stored in 8 bytes. ​ This is equivalent to a “datatype FLOAT length 8”.
 +
 +<​code>​
 +Figure 2 - Examples of Declaring Datatypes Using New and Existing Syntax
 +New syntax Existing syntax
 +datatype CHARACTER(10) datatype CHARACTER length 10
 +datatype C STRING(10M) datatype C STRING length 1000001
 +datatype TINYINT datatype INTEGER length 1
 +datatype SMALLINT datatype INTEGER length 2
 +datatype INTEGER datatype INTEGER length 4
 +datatype BIGINT datatype INTEGER length 8
 +datatype FLOAT datatype FLOAT length 4
 +datatype DOUBLE datatype FLOAT length 8
 +datatype ORACLE DATETIME datatype ORACLE DATETIME length 7
 +datatype OMNIDEX DATE(4) format MMDD datatype OMNIDEX DATETIME length 2 format MMDD
 +
 +Figure 3 - Declaring Omnidex Datatypes in the Environment File
 +Description Number Value in Parentheses  ​
 +For New Syntax Value after LENGTH
 +For Existing Syntax
 +CHARACTER 100 characters characters
 +C STRING 201 characters characters + null terminator
 +VARCHAR 1700 characters characters
 +CLOB 1800 characters characters
 +NATIONAL CHARACTER 102 characters characters * 2
 +NATIONAL C STRING 202 characters (characters + null terminator) * 2
 +NATIONAL VARCHAR 1701 characters characters * 2
 +NATIONAL CLOB 1801 characters characters * 2
 +OMNIDEX VARCHAR 1799 characters characters + 4
 +OMNIDEX CLOB 1899 characters characters + 4
 +[SIGNED] TINYINT 301 1
 +UNSIGNED TINYINT 401 1
 +[SIGNED] SMALLINT 302 2
 +UNSIGNED SMALLINT 402 2
 +[SIGNED] INTEGER 300 1,​ 2, 4 or 8
 +UNSIGNED INTEGER 400 1,​ 2, 4 or 8
 +[SIGNED] BIGINT 303 8
 +UNSIGNED BIGINT 403 8
 +FLOAT 600 4 or 8
 +DOUBLE 605 8
 +DATE 1000 10
 +ODBC DATE 1007 6
 +DB2 DATE 1009 6
 +INFORMIX DATE 1100 4
 +ASCII DATE 1101 6 or 8 (optional, default of 8) 6 or 8
 +OMNIDEX DATE 1102 2-8 (optional, default of 8) 1-4
 +TIME 1199 11
 +ODBC TIME 1200 6
 +DB2 TIME 1202 6
 +OMNIDEX TIME 1207 2-8 (optional, default of 8) 1-4
 +DATETIME 1208 22
 +ORACLE DATETIME 1206 7
 +ODBC DATETIME 1205 6
 +DB2 DATETIME 1208 16
 +INFORMIX DATETIME 1206 24
 +C DATETIME 1205 4
 +OMNIDEX DATETIME 1299 2-16 (optional, default of 16) 1-8
 +BLOB 1900 bytes bytes
 +OMNIDEX BLOB 1999 bytes bytes + 4
 +</​code>​
 +
 +==== LENGTH n ====
 +
 +Required. Declares the storage length (as n) of the column in bytes.
 +
 +C String data is terminated by a null character. Therefore, length must be increased by 1 to accommodate the null character. For example, a two character State field defined as a C String will have a length of 3: two for the abbreviated state and one for the null character.
 +
 +== SCALE n ==
 +
 +Optional. Sets the magnitude of numeric values. OmniAccess does not format data based on SCALE. SCALE is reported in the Environment file and the System Catalog. SCALE is used by the Omnidex ODBC and JDBC drivers as well as for meta-data purposes.
 +
 +
 +== PRECISION n ==
 +
 +Optional. Specifies the number of decimal places in numeric values. OmniAccess does not format data based on PRECISION. PRECISION is reported in the Environment file and the System Catalog. PRECISION is used by the Omnidex ODBC and JDBC drivers as well as for meta-data purposes.
 +
 +== FORMAT format_spec ==
 +
 +Optional. Applies to Omnidex date class data types only. This means this setting will only apply to flat file databases, since a flat file database is the only database that will contain an Omnidex date class data type. Refers to the granularity of the date data stored in the database.
 +
 +This setting DOES NOT affect the appearance of returned data.
 +
 +== PHYSICAL "​native_column_name” ==
 +
 +Optional. This is a quoted string of up to 255 characters that maps the logical column name to the native column'​s name. This refers to native columns. Expressions and functions are not allowed.
 +
 +USAGE usage_spec
 +USAGE [ASCENDING] [AUTO] ROWID
 +
 +Optional. Defines a column as the id column. Use AUTO for columns where the id value is automatically assigned by the DBMS. Use ASCENDING only when the id value is 100% guaranteed to be sequentially ascending from 1.
 +
 +CENTURY THRESHOLD n
 +Optional. Specifies the year cutoff for determining the century in 2 digit years. For example, if the century threshold is set to 60, a 2 digit year of 45 would be translated to 2045 and a 2 digit year of 61 would be translated to 1961. This setting over-rides the century threshold setting in the environment section.
 +
 +OMNIDEX
 +Optional. The OMNIDEX section is used to index data in a format other than its native format. The keyword OMNIDEX is a section identifier for the OMNIDEX section of the COLUMN statement and is required if an OMNIDEX section is declared. Definitions in this section apply to the Omnidex indexes only.
 +
 +This section is used ONLY if you want to override the way the indexes are stored by default. Most applications will not have an OMNIDEX section.
 +
 +DATATYPE datatype_spec
 +Optional. Declares the data type format of the defined column. The DATATYPE keyword is required. See Supported Datatypes for a list of supported datatypes.
 +
 +LENGTH n
 +Required. Declares the storage length (as n) of the column in bytes.
 +
 +C String data is terminated by a null character. Therefore, length must be increased by 1 to accommodate the null character. For example, a two character State field defined as a C String will have a length of 3: two for the abbreviated state and one for the null character.
 +
 +FORMAT format_spec
 +Optional. Applies to date class data types only. Refers to the granularity of the date data stored in the index files. NOTE: This setting DOES NOT affect the appearance of returned data.
 +
 +AS "​select_item"​
 +Optional. Generates Pseudo-columns using SQL standard expressions and functions, with limitations. Pseudo-columns allows columns to be included in the environment file that do not exist in the native database.
 +
 +select_item can be an expression or function. The pseudo-column is read/write.
 +
 +SQL SELECT "​string"​
 +Optional. Generates Pseudo-columns using native database functions and expressions. Values are read-only.
 +
 +Unless the column data can only be generated through native database functions that are not supported by Omnidex, DISC highly recommends that the AS select_item (above) clause be used instead of the SQL SELECT string clause.
 +
 +SQL SELECT clauses support any of the following tokens that represent the current DATABASE, TABLE or COLUMN.
 +
 +%d represents the DATABASE wherever it appears in the string.
 +%t represents the TABLE wherever it appears in the string.
 +%c represents the COLUMN wherever it appears in the string.
 +To pass double quotes ( " ) in a rule to the native database, enclose the string in single quotes ( ' ). The converse is true for single quotes. Mixing double quotes and single quotes within strings is not supported. The following illustrates a few valid examples:
 +
 +SQL SELECT "​to_char(%t.%c)"​
 +
 +SQL SELECT "%t.%c + %t.AMOUNT"​
 +
 +SQL SELECT "%t.%c * 1.0725"​
 +
 +PROMPT "​string"​
 +Optional. This is a string of up to 32 characters used when setting a prompt for a value for the field. Prompt is for meta-data purposes only. It is not used by Omnidex in any way but is included as meta-data with some info calls.
 +
 +HEADING "​string"​
 +Optional. This is a string of up to 32 characters used when setting a heading or name for a field appearing above the column being reported. Heading is for meta-data purposes only. It is not used by Omnidex in any way but is included as meta-data with some info calls.
 +
 +== LABEL "​string"​ ==
 +
 +Optional. This is a string of up to 32 characters used when setting a label or name for a field, appearing to the left of the column being reported. Label is for meta-data purposes only. It is not used by Omnidex in any way but is included as meta-data with some info calls.
 +
 +== CARDINALITY n ==
 +
 +The cardinality of a column is the number of distinct values in the column. This number should be near the actual column cardinality. Omnidex uses this number to better optimize some queries.
 +
 +===== $RETRIEVE_FILE =====
 +
 +<​code>​
 +$RETRIEVE_FILE(filename [,​’datatype’ [,length [,​’options’]]])
 +
 +filename A string literal, a column, or an expression containing the filename to retrieve.
 +
 +datatype The datatype to be used for retrieving the file’s content. ​ Typically a CLOB or C STRING is used to retrieve ASCII data such as text and HTML, and BLOB is used to retrieve binary data such as Microsoft Word and Adobe PDF documents. ​ Alternatively,​ a CLOB can be used to retrieve the text from Microsoft Word and Adobe PDF documents if the EXTRACT_TEXT option is used.  ​
 +
 +Datatypes are specified in textual form, and may be used with or without lengths. ​ If no lengths are specified, then they must be included in the length parameter. ​ If no datatype is specified, then CLOB is presumed.
 +
 +length The length to be used for retrieving the file’s content. ​ Lengths may also be specified in the datatype parameter using the standard Omnidex syntax. ​ If no length is provided in either place, the length defaults to 64KB.
 +
 +options The options to be applied to retrieving this file.  ​
 +
 +EXTRACT_TEXT Extract the text from the file, rather than returning the exact contents of the file.
 +
 +AUTO_EXTENSION If the passed filename does not exist, and if the passed filename does not contain an extension, and if a single file exists with this name plus an extension, the open that file.  This option allows filenames to be included without an extension as long as only one file is possible.
 +STOPWORDS= Use the STOPWORDS list identified by this option.
 +
 +PARSE Parse the keywords from the text and discard all whitespace and punctuation.
 +
 +The $RETRIEVE_FILE function returns a buffer using the datatype and length specified in the parameters. ​ If no parameters are specified, then the default datatype and length are returned.
 +</​code>​
 +
 + 
  
 ===== INDEX ===== ===== INDEX =====
  
 +  INDEX index_name
 +      TYPE index_type_spec
 +      AS column_spec [, column_spec...]
 +     ​[PHYSICAL "​native_index"​]
 +
 +== INDEX index_name ==
 +
 +[[environment_name.]database_name.]index_name
 +
 +index_name represents a non-ambiguous index or view.
 +
 +index_name MUST BEGIN WITH A LETTER, A-Z (case insensitive) and may contain up to 32 characters including letters, numbers and allowed special characters.
 +
 +If index_name contains any reserved words or allowed special characters, it must be enclosed in single or double quotes.
 +
 +If the underlying database contains native indexes for any of the tables defined in the Omnidex Environment Catalog, you must declare these indexes in this section. If not declared, data retrievals will either be performed by serial read or return incorrect data.
 +
 + 
 +
 +== TYPE index_type_spec ==
 +
 +Required when declaring an INDEX index and can declare any one of these values:
 +
 +INVERTED
 +HASHED
 +SORTED
 +LINKED LIST
 + 
 +
 +== AS column_spec [, column_spec...] ==
 +
 +Required when declaring an INDEX index. This string, up to 32 characters long, uniquely identifies the column defined within the Environment to which the native index corresponds.
 +
 + 
 +
 +== PHYSICAL "​native_index"​ ==
 +
 +Optional. This is a quoted string of up to 255 characters which references the underlying database'​s native name for the index.
 ===== NODE ===== ===== NODE =====
       NODE nodename       NODE nodename
Line 275: Line 609:
           CLUSTER table           CLUSTER table
               [PARTITION BY criteria_expression               [PARTITION BY criteria_expression
 +===== MESSAGE =====
 +
 +  [MESSAGE message_name
 +       { [TEXT] "​string"​ | FILE "​filespec"​}]
 +
 +== MESSAGE message_name ==
 +
 +Messages are optional. If defining a message, the MESSAGE keyword and message name are required. This is a string of up to 64 characters (or numbers) that uniquely identifies the specified message in the Environment. The message is accessible by the OmniAccess API function call oamessage.
 + 
 +
 +== [TEXT] "​string"​ | FILE "​filespec"​ ==
 +
 +Required. The text sting is a quoted string of up to 255 characters specifying the desired message. The TEXT keyword is optional.
 +
 +OR
 +
 +Use an external file that contains a message. filespec is a quoted string up to 255 characters in length and may contain any valid filename as well as appropriate path information and password information. The enclosing quotes may be single or double quotes. The FILE keyword is required.
 +
 +===== RULE =====
 +
 +  [RULE rule_name
 +      {"​string"​ | FILE "​filespec"​}]
 +
 + == RULE rule_name ==
 +
 +Rules are optional. If defining a rule, the RULE keyword and rule name are required.
 +
 +This is an unambiguous name, up to 64 characters and can contain letters, A - Z (case insensitive) or numbers. ​
 +rule_name must begin with a letter.
 +
 + 
 +
 + 
 +
 +== "​string"​ | FILE "​filespec"​ ==
 +
 +Required. The string is a quoted string of up to 255 characters defining the "​rule"​.
 +
 +OR
 +
 +Use an external file that contains the rule definition. filespec is a quoted string up to 255 characters in length and may contain any valid filename as well as appropriate path information and password information. The enclosing quotes may be single or double quotes. The FILE keyword is required.
 +
 ===== Example - Creating a simple Omnidex Environment Flatfile database with simulated Networked ODBC  ===== ===== Example - Creating a simple Omnidex Environment Flatfile database with simulated Networked ODBC  =====
  
 
Back to top
oaenv/home.1260210213.txt.gz · Last modified: 2012/10/26 14:20 (external edit)