Action disabled: source

DRAFT

OdxSQL Overview

OdxSQL is a console program used for creating and maintaining Omnidex environments, testing installations, prototyping queries, and exporting data. OdxSQL supports many functions designed to assist in creating fully optimized installations and queries including benchmarking and for executing explain plans to determine query performance.

OdxSQL allows the interactive or script processing of OdxSQL commands and Omnidex SQL Statements.

OdxSQL allows the interactive specification of Omnidex SQL statements as well as OdxSQL specific commands. OdxSQL is primarily used to:

  • Create and maintain Omnidex Environments.
  • Test query results from a newly created Omnidex indexes with SELECT statements.
  • Profile performance of queries using the timer functions.
  • Run Explain Plans to determine the usage of Omnidex indexes.
  • Perform data utility functions such as partitioning or analyzing data.
  • Test ODBC performance using OdxSQL's ODBC interface either on the server or across the network.
  • Test JDBC performance using OdxSQL's JDBC interface either on the server or across the network.
  • Exporting data using SELECT statement operations.

OdxSQL connects to either an Omnidex Environment which can either be specified as a run time argument or via the CONNECT command once OdxSQL is running.

Program Operation

Run OdxSQL from the command line with the following syntax:

os>odxsql [Omnidex_Environment_filespec] | 
          [-help | -? ]        
          [ -version  ]        
          [ -use=filespec ]
          [ -cmd='cmd1;cmd2' ]
          [ -where='criteria' ]
          [ -exit ]              
          [ -exit_on_error ]     
          [ -nobanner ]          
          [ -cloa ]              
          [ -odbc ]
          [ -jdbc ]
          [ -odxnet
              [=port] ]

Getting Help

Type help at the command prompt with no arguments to see an alphabetical list of ODXSQL commands.

   >help

Type help with the argument 'syntax' at the command prompt to see a list of commands with their syntax.

   >help syntax

Type help followed by a specific command to see additional information about that command.

   >help connect
   CONNECT
   Connect to an environment file
   Syntax:
   Connect [TO] filename [AS [user]/[password]] [WITH options]

See HELP in the OdxSQL Commands section for more information.

Commands

Overview

OdxSQL is used to process a wide range of Omnidex SQL Statements and OdxSQL specific commands.

The OdxSQL Commands and Omnidex SQL Statements are organized for quick review as follows:

OdxSQL Commands and Omnidex SQL Statements can be entered into OdxSQL in ether upper or lower case.

> connect myenv
> CONNECT myenv

The syntax for Omnidex SQL Statements entered into OdxSQL or processed in a script file is typically the exact same syntax and returns the exact same results.

There are a few exceptions such as CONNECT and VERSION.

In OdxSQL, CONNECT has two additional options of ON host:port and USING api that are not available in the Omnidex SQL CONNECT Statement. The api is not necessary has it is already known depending on the application type (ODBC or JDBC) and ON

In OdxSQL, the VERSION command displays the OdxSQL header and multiple lines of version information where the Omnidex SQL VERSION statement returns a single line.

The OdxSQL EXECSQL command can be used to verify if an Omnidex SQL Statement is processed exactly the same by OdxSQL as the Omnidex SQL parser.

> VERSION
ODXSQL - Omnidex SQL                                   Wed Dec 02 09:20:41 200
...
Omnidex Version                  5.0 Build 2B
Compilation Timestamp            Oct 13 2009  08:57:09
Earliest Compatible ODBC Client  4.3 Build 4B
Earliest Compatible JDBC Client  4.3 Build 4B
Earliest Compatible Odx Kernel   5.0 Build 1B

> EXECSQL VERSION
OmniAccess version 50002
> 

Settings

Setting Option Description
CURSORDISPLAY ON/OFF
>SET CURSORDISPLAY ON
>connect /users/garment.env
Connected to /users/garment.env on instance 1, cursor 1
>connect / users/orders.env
Connected to /users/orders.env on instance 2, cursor 2
SELECT COMPANY, CONTACT, PHONE FROM CUSTOMERS WHERE STATE='CO' ON CURSOR 2
...
INSERT INTO CUSTOMERS (COMPANY, CONTACT) VALUES ('New Wave', 'Mr. Smith') ON CURSOR 1
...

OdxSQL Environment Variables

Certain aspects of OdxSQL can be controlled through OS environment variables.

Environment Variable Description
ODXSQL_API Specifies which API to use: OA (default), ODBC or JDBC.
OSXSQLHIST Specifies a different history file for saving OdxSQL history.
ODXSQLINIT Specifies a text file of OdxSQL initialization commands.
ODXSQL_API

ODXSQL_API specifies which API to use, OA (default) or ODBC during this ODXSQL session.

If running ODXSQL on a client machine where the Omnidex server software has not been installed, this variable MUST be set to ODBC, since the OA API does not exist on the client.

Unix

export ODXSQL_API="OA"

Windows

set ODXSQL_API="ODBC"
ODXSQLHIST

ODXSQL_HIST_FILE points to an ODXSQL History File. By default, the ODXSQL command history is written to .odxsql_history. Use this variable to write the history to a different file.

Unix

export ODXSQLHIST="myhistoryfile.txt"

Windows

set ODXSQLHIST="myhistoryfile.txt"
ODXSQLINIT

ODXSQLINIT points to an OdxSQL Init File. This file can contain initialization settings that will be set when OdxSQL starts. This is very useful for set options.

Unix

export ODXSQLINIT="init_file.txt"

Windows

set ODXSQLINIT="init_file.txt"

OdxSQL Uses

OdxSQL is a console application for manually entering Omnidex SQL Statements and OdxSQL Commands or for processing scripts of Omnidex SQL statements.

Use OdxSQL for processing Omnidex SQL Data Definition Scripts to create Omnidex Environments and Indexes.

Use OdxSQL to test Omnidex SQL SELECTs and ODBC, JDBC and Network Services set up.

Use OdxSQL to prototype Omnidex Queries and use the Explain Command to review optimization.

Use OdxSQL on a client computer to access an Omnidex Environment on a remote server via OdxNet to test network response times.

Common ways to run OdxSQL

os> odxsql
os> odxsql envfile
os> odxsql dsnfile -odxnet -odbc
os> odxsql -?
os> odxsql -use scriptfile

Running OdxSQL Explained:

odxsql Run OdxSQL. Use the CONNECT command to connect to an Omnidex Environment
odxsql envfile Run OdxSQL and connect to the 'envfile'
odxsql dsnfile -odxnet -odbc Run OdxSQL and an OdxNET background process and connect to the DSN using ODBC
odxsql -? Displays OdxSQL command line options
odxsql -use scriptfile Run OdxSQL and read and process the scriptfile of OdxSQL Statements and Commands.

OdxSQL Important Information

  • OdxSQL connects to an Omnidex Environment or ODBC or JDBC Omnidex File Datasource (DSN).
    • connect myenv.xml
    • connect mydsn.dsn using odbc (needs OdxNet running)
    • connect mydsn.dsn using jdbc (needs OdxNet running)
  • OdxSQL requires a semicolon terminator for SQL Statements and will prompt for additional statement information until a semicolon is found.
  • Use SET TERMINATION OFF and OdxSQL will not required the semicolon termination character and will end the statement automatically.
  • With SET TERMINATION OFF, use the backslash [ \ ] statement continuation character for multi line statements.
  • Use HELP <cr> to display a list of commands and SQL Statements.
  • Use HELP <command> to display the syntax for the command.
  • Use SHOW <table> to show information on a table with the tables's column layout.
    • Use SHOW ALL to see all tables, including internal system tables.
  • Create scripts with an editor and process with the USE <scriptfile> command or the OdxSQL -use scriptfile
  • Use EDIT to edit the last statement using Windows Notepad or Linux/Unix vi or emacs.
  • Use SET EDIT to change the editor of choice.
  • Use EDIT file to edit a script file without leaving OdxSQL and then USE file to run.
  • Use EDIT n to edit a command in the Command History Stack.
  • Edit previous commands by using the UP ARROW and scrolling through the commands.
    • Use the Right and Left Arrow, Insert, Delete, Home, and End keys to edit.
  • Use HISTORY to display a numbered list of previous commands.
    • Use the history number to re-execute the numbered command.
    • Use a period ( . ) to execute the last command.

See Also

OdxSQL Internal SET Commands

Internal
x [AUTOPSEUDOCOLUMNS <ON | OFF>]
x [AUTORECONNECT <ON | OFF>]
x [AUTOSUBPROCESS <n | NONE>
x [STATISTICS_COMMENT "string"]
x [PREPROCESSOR <ON | OFF>]
x [PROGRESS <ON | OFF>]
x [MEMORY_BASELINE]
x [FILE_BASELINE]

Level 2 Headline

        SET DEBUG …
	SET OPTIMIZATION …
	SET REQUIRED_OPTIMIZATION
	SET CHAR …
	SET TIMEOUT …
	SET REDEFROWIDS …	
	SET PSEUDOCOLUMNS …
	SET QUALIFY_MODE <ODXFIND | PARSER >
	SET AUTOPSEUDOCOLUMNS …
	SET PREPROCESSOR …
	SET SQL_LOGGING …
	SET SQL_LOGFILE …

The syntaxes of the SQL Logging SET commands are shown below:

  set sql_logging <on | off> 

This command activates SQL Logging for this process. By default, statements are logged to the $SQL_STATEMENTS file along with statistics about the execution of the command. The $SQL_STATEMENTS file is named “sqllog.tdf”, and is located in the same directory as the compiled environment file. This file is a standard tab-delimited file, and may be easily imported into other applications. The file may be flushed by simply removing the file; the file will be automatically recreated the next time logging is activated.

  set sql_logfile <filename>

This command redirects the SQL logging for this process to a text file that only contains the statement, and does not contain any statistical information. If the file already exists, it will be appended to rather than overwritten.

 
Back to top
programs/odxsql/overview.txt · Last modified: 2016/06/28 22:38 (external edit)