This is an old revision of the document!
The following sample Environment Catalog Source is the minimum set of statements that will compile into an Omnidex Compiled Environment.
CREATE ENVIRONMENT tinyenv IN "odx.xml" WITH delete; CREATE DATABASE tinydb TYPE flatfile IN "odx.xml"; CREATE TABLE table1 ( myseq INTEGER, mytext char(50) quicktext, ) IN "odx.xml";
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.sql”.
os> odxsql odxsql> use tiny.sql odxsql> exit
os> odxsql tiny.xml
or
os> odxsql > connect tiny.xml
C:\dev\odx\tiny>odxsql tiny.xml 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.xml > 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 3 rows returned >
C:\dev\odx\tiny>odxsql tiny.xml update indexes
After creating an Omnidex Environment and adding Omnidex indexes via UPDATE INDEXES, applications can be developed using the DISC provided ODBC and JDBC drivers.
Network aware Omnidex applications can either use an ODBC style datasource file or an internal connection string.
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 -odbc
or run an ODXNET listener from within OdexSQL using the -odxnet command line option.
os> odxsql -odxnet odxsql> connect tiny using odbc
odxsql> 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