This is an old revision of the document!
ENVIRONMENT < environment_name >
DATABASE < database_name > TYPE < flatfile |
TABLE < tablename | "tablename" > [ TYPE < ROLLUP | > ] [ PHYSICAL "filespec" ] [ AS "select_statment" ] [ PRIMARY KEY “col1”,”col2” ] [ FOREIGN KEY “col1”,”col2” REFERENCES “table1”(“col1”,”col2”) ] < COLUMN column_spec [ COLUMN column_spec ... > ]
COLUMN column-name DATATYPE datatype-spec [PROXIMITY “options”] [SYNONYMS 'options'] [SPELLCHECK 'options'] [MISSPELLINGS 'options'] [FORMS 'options'] [STOPWORDS 'options'] [PHONETIC 'options'] [INCLUDED_TAGS 'options'] [EXCLUDED_TAGS 'options'] {AS < columnspec | "$retrieve_file(FILENAME)" > ]
NODE nodename DATABASE dbname FILEDSN "dsn" [ LOCAL ] [ CACHE ] CLUSTER table [PARTITION BY criteria_expression
The following sample Environment Catalog Source is the minimum set of statements that will compile into an Omnidex Compiled Environment.
ENVIRONMENT tinyenv DATABASE tinydb TYPE flatfile TABLE table1 COLUMN myseq DATATYPE INTEGER COLUMN mytext DATATYPE CHAR(60)
This creates an Omnidex Environment named “tinyenv” with a single Database named “tinydb” with one table named “table1”. Because the DATABASE TYPE is “flatfile”, the name of the underlying operating system file for this table is “table1”. Typically a filespec location would be used. Copy and save this environment as “tiny.src”.
os> oacomp tiny.src tiny.env
os> odxsql tiny.env
or
os> odxsql > connect tiny.env
> create file table1
> insert into table1 values (1)
> select * from table1
C:\dev\odx\tiny>more tiny.src ENVIRONMENT tinyenv DATABASE tinydb TYPE flatfile TABLE table1 COLUMN mysq DATATYPE INTEGER COLUMN mytext DATATYPE CHAR(60) C:\dev\odx\tiny>oacomp tiny.src tiny.env OACOMP - Omnidex Environment Compiler Mon Nov 30 21:41:50 2009 (c) Dynamic Information Systems Corp. 1981-2009 5.0 Build 1H Microsoft Windows XP Professional SP 3 (2600) TDO830/TDO ** Trial Copy ** Parsed; Validated; Compiled; Done ** Environment Compiled Successfully! ** C:\dev\odx\tiny>odxsql tiny.env ODXSQL - Omnidex SQL Mon Nov 30 21:41:59 2009 (c) Dynamic Information Systems Corp. 1981-2009 5.0 Build 1H Microsoft Windows XP Professional SP 3 (2600) TDO830/TDO ** Trial Copy ** Connected to C:\dev\odx\tiny\tiny.env > create file table1 File table1 created > insert into values (1, 'lions, tigers, and bears') 1 row inserted into TABLE1 > insert into values (2, 'lions, tigers, kittys, cougars') 1 row inserted into TABLE1 > insert into valu (3, 'The teddy bears are having a picnic') 1 row inserted into TABLE1 > select * from table1 MYSEQ MYTEXT ----------- ------------------------------------------------------------ 1 lions, tigers, and bears 2 lions, tigers, kittys, cougars 3 The teddy bears are having a picnic 1 row returned >
C:\dev\odx\tiny>dbinstal DBINSTAL - Omnidex Database Indexing Utility Tue Dec 01 07:30:37 2009 (c) Dynamic Information Systems Corp. 1981-2009 5.0 Build 1H Microsoft Windows XP Professional SP 3 (2600) TDO830/TDO ** Trial Copy ** Database or Environment: tiny.env Cmd: install ** OMNIDEX MultiDimensional/Keyword (MDK) Index Installation ** Enter Tables and Columns to be indexed To create an index comprised of all or parts of one or more columns, enter an Index Name followed by '!' at the Column prompt Enter '?' for a list of Tables or Columns, '/' to exit the current prompt Table name? table1 To index this table in any parent domains, enter the column linking it to its parent or 'P=' followed by the parent name Link column 1: / Table will be indexed in its own domain Column name: mytext;kw Column name: / Table name? / Specification of MDK indexes is complete ** OMNIDEX Aggregation/Sorted_Key (ASK) Index Installation ** Table name? / Proceed with installation? [Y] Use the Build command to load the following indexes: TABLE1 (Omnidex MDK) Cmd: build Table [;key] table1 Unloading keywords TABLE1: 3 records (15 keywords) processed 15 keywords unloaded 0 (0MB), 1 (1MB), 0 (0MB) Loading keywords 15 keywords loaded 2 blocks used, 2 levels Indexing complete. CPU time: 0:00:00 Elapsed: 0:00:00 Cmd: quit C:\dev\odx\tiny>
After creating an Omnidex Environment and adding Omnidex indexes via DBINSTAL, applications can be developed using the DISC provided ODBC and JDBC drivers.
Create an ODBC or JDBC datasource using the Windows Client DataSource Editor (DSEDIT).
Name the file as “tiny.dsn”.
Or modify the following text file and save as tiny.dsn. Change the following lines to the correct path and filenames.
Change these three lines with:
Cut and paste this text as “tiny.dsn” with the modifications and save in the same directory as the “tiny.env” Omnidex Environment file.
Host=tdo830 ODBCDSNFILE=C:\dev\odx\tiny\tiny.dsn FileSpec=c:\dev\odx\tiny\tiny.env
ODBC] DRIVER=DISC OMNIDEX OdxNet Driver ODBCDSNFILE=C:\dev\odx\tiny\tiny.dsn ODBCDSNNAME=tinydsn [DataSources] tinydsn=DataSource Edit Wizard Generated [DataSource tinydsn] Dictionary=tinydsn DisplayWindow=NONE [Dictionaries] tinydsn=DataSource Edit Wizard Generated [Dictionary tinydsn] Server=Server1 NetworkServices=OdxNet Type=OmniAccess FileSpec=c:\dev\odx\tiny\tiny.env HostOAConnectOptions= Password=!~ AccessOptions=Write [Servers] Server1=DataSource Edit Wizard Generated [Server Server1] Host=tdo830 Port=7555
Start a new command window as odxnet will run and await connections in the new command window.
os> odxnet
Go back to the original command window and do the following:
os> odxsql tiny.dsn -odbc
or run an ODXNET listener from within OdexSQL using the -odxnet command line option.
os> odxsql -odxnet > connect tiny.dsn using odbc
> select * from table1 where mytext = 'bears' MYSEQ MYTEXT ----------- ------------------------------------------------------------ 1 lions, tigers, and bears 3 The teddy bears are having a picnic
Note that Omnidex will do a quick text (Keyword) retreival automatically
> insert into table1 values (4, 'Da Bears') 1 row inserted into TABLE1
> select * from table1 where mytext = 'bears' MYSEQ MYTEXT ----------- ------------------------------------------------------------ 1 lions, tigers, and bears 3 The teddy bears are having a picnic 4 Da Bears