Differences

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

Link to this comparison view

programs:odxsql:commands [2015/06/10 20:49]
doc
programs:odxsql:commands [2016/06/28 22:38]
Line 1: Line 1:
-{{page>:​top_add&​nofooter&​noeditbtn}} 
-~~NOTOC~~ 
- 
-====== Programs: OdxSQL ====== 
- 
-[[programs:​odxsql:​home|Overview]] | **[[programs:​odxsql:​commands|Commands]]** | [[programs:​odxsql:​options|Options]] | [[programs:​odxsql:​cmdline|Command-line]] | [[programs:​odxsql:​files|Command Files]] ​ 
- 
- 
----- 
- 
- 
-===== Commands ===== 
- 
-The following commands are available in OdxSQL: 
- 
- 
-==== ATTACH DATABASE ==== 
- 
-The ATTACH DATABASE command attaches a database from one environment into the currently connected environment,​ thereby allowing SQL statements to access both databases. 
- 
-<​code>​ 
-ATTACH DATABASE database [AS alias] FROM filename [ON [INSTANCE] instance] 
-  [WITH options] 
-</​code>​ 
- 
-==== ATTACH SEGMENT ==== 
- 
-The ATTACH SEGMENT command attaches a previously-created segment into the currently connected environment so that it can be referenced in subsequent SQL statements. ​ Segments are created using the CREATE SEGMENT command. ​ 
- 
-<​code>​ 
-ATTACH <INDEX | DATA> SEGMENT segment [PHYSICAL physical] 
-  [ON [INSTANCE] instance] [WITH options] 
-</​code>​ 
- 
-==== ATTACH TABLE ==== 
- 
-The ATTACH TABLE command attaches a raw data file or a delimited file into the currently connected environment,​ thereby allowing SQL statements to access both databases. ​ Note that attached tables are not indexed with Omnidex. ​ For attaching indexed tables, use the ATTACH DATABASE command. 
- 
-<​code>​ 
-ATTACH TABLE table [PHYSICAL "​physical"​] (column [, column ...]) 
-  [ON [INSTANCE] instance>​] [WITH options] 
-  column: column-name datatype (length) 
-</​code>​ 
- 
-==== BENCHMARK ==== 
- 
-The BENCHMARK command provides a menu of performance benchmarks that can be performed, focusing on POSIX file I/​O.  ​ 
- 
-<​code>​ 
-BENCHMARK [<table | select-statement>​] [WITH options] 
-</​code>​ 
- 
-==== CALC ==== 
- 
-The CALC command provides a very basic calculator, allowing formulas like "CALC (123+456)*789"​. 
- 
-<​code>​ 
-CALC expression 
-</​code>​ 
- 
-==== CD ==== 
- 
-The CD command changes the current working directory within the OdxSQL session. ​ The current working directory outside of OdxSQL remains unchanged. 
- 
-<​code>​ 
-CD [path] 
-</​code>​ 
- 
-==== CLOSE CURSOR ==== 
- 
-The CLOSE CURSOR command closes a cursor that was previously opened using the OPEN CURSOR command. 
- 
-<​code>​ 
-CLOSE CURSOR [[ON] CURSOR] cursor] [WITH options] 
-</​code>​ 
- 
-==== CONNECT ==== 
- 
-The CONNECT command connects to an Omnidex environment file.  The USING clause allows the connection to be performed using the ODBC or JDBC client interfaces. 
- 
-<​code>​ 
-CONNECT [TO] connection_string [USING api] [WITH options] 
-  Connection string syntax: 
-    [ host:​port:​pool ] filename [ node ] &​options 
-  Examples: 
-    CONNECT example.xml 
-    CONNECT [server1:​7555]example.xml 
-    CONNECT [server1:​7555:​pool1] 
-</​code>​ 
- 
-==== CONVERT ==== 
- 
-The CONVERT command allows a SELECT statement to be exported while interactively prompting for data conversions of each retrieved column. 
- 
-<​code>​ 
-CONVERT [statement TO filename [ON [CURSOR] cursor] [WITH options] 
-</​code>​ 
- 
-==== CREATE DATABASE ==== 
- 
-The CREATE DATABASE command allows a database to be declared in an Omnidex environment file.  For details on CREATE DATABASE statements for each database type, consult the [[integration:​home|Integration section]] of the documentation. 
- 
-<​code>​ 
-CREATE DATABASE database ​ 
-  ... 
-  IN "​filename"​ [WITH options] 
-</​code>​ 
- 
-==== CREATE ENVIRONMENT ==== 
- 
-The CREATE ENVIRONMENT command creates a new Omnidex environment file. 
- 
-<​code>​ 
-CREATE ENVIRONMENT environment ​ 
-  [OPTIONS options] 
-  [NODE node_declaration] 
-  IN "​filename"​ 
-</​code>​ 
- 
-==== CREATE INDEX ==== 
- 
-The CREATE INDEX and CREATE INDEX GROUP commands create indexes in an Omnidex environment file.  For details on CREATE INDEX and CREATE INDEX GROUP statements, consult the [[admin:​indexing:​creation:​home|Index Creation section]] of the documentation. 
- 
-<​code>​ 
-CREATE <OMNIDEX | QUICKTEXT | FULLTEXT | CUSTOM | NATIVE> INDEX 
-  [[(owner)]table.]index [ON table] 
-  (<column | substring>​ [, <column | substring>​ ...])] 
-  [attribute [attribute ...]] IN "​filename"​ [WITH options] 
- 
-CREATE INDEX GROUP [(owner)]group 
-  (table.index [, table.index ...])] IN "​filename"​ [WITH options] 
-</​code>​ 
- 
- 
-==== CREATE SEGMENT ==== 
- 
-The CREATE SEGMENT command creates a data segment or an index segment, thereby allowing it to be referenced in subsequent queries. 
- 
-<​code>​ 
-CREATE [<​TEMPORARY | PERMANENT>​] <INDEX | DATA> SEGMENT segment 
-  [PHYSICAL physical] [AS (select)] [ON [CURSOR] cursor] 
-  [WITH options] 
-</​code>​ 
- 
-==== CREATE TABLE ==== 
- 
-The CREATE TABLE command creates a table in the current connection. ​ If the IN clause is used, then the CREATE TABLE command creates a table declaration in an Omnidex environment file.  For details on CREATE TABLE statements for each database type, consult the [[integration:​home|Integration section]] of the documentation. 
- 
-<​code>​ 
-CREATE [<​[<​GLOBAL | LOCAL>] TEMPORARY | PERMANENT>​] TABLE table 
-  [PHYSICAL "​physical"​] (column [, column ...]) 
-  [<IN "​filename"​ | ON [INSTANCE] instance>​] [WITH options] 
-  column: column-name datatype (length) 
-</​code>​ 
- 
-column: column-name datatype (length) 
- 
-==== DATE ==== 
- 
-The DATE command shows the current date and time. 
- 
-<​code>​ 
-DATE 
-</​code>​ 
- 
-==== DELETE ==== 
- 
-The DELETE command deletes one or more rows from a table. 
- 
-<​code>​ 
-DELETE FROM table [WHERE <​predicate-list | CURRENT> 
-  [<ON | OF> [CURSOR] cursor]] [WITH options] 
-</​code>​ 
- 
-==== DETACH DATABASE ==== 
- 
-The DETACH DATABASE command detaches a database that was previously attached using the ATTACH DATABASE command. 
- 
-<​code>​ 
-DETACH DATABASE database [ON [INSTANCE] instance] [WITH options] 
-</​code>​ 
- 
-==== DETACH SEGMENT ==== 
- 
-The DETACH SEGMENT command detaches a segment that was previously attached using the ATTACH SEGMENT command. 
- 
-<​code>​ 
-DETACH SEGMENT segment [ON [INSTANCE] instance] [WITH options] 
-</​code>​ 
- 
-==== DETACH TABLE ==== 
- 
-The DETACH TABLE command detaches a table that was previously attached using the ATTACH TABLE command. 
- 
-<​code>​ 
-DETACH TABLE table [ON [INSTANCE] instance] [WITH options] 
-</​code>​ 
- 
-==== DIR ==== 
- 
-The DIR command lists the files named in the fileset, optionally showing details for each file. 
- 
-<​code>​ 
-DIR fileset [WITH options] 
-</​code>​ 
- 
-==== DISCONNECT ==== 
- 
-The DISCONNECT command disconnects from the Omnidex environment file. 
- 
-<​code>​ 
-DISCONNECT [ALL] [[ON [INSTANCE]] instance] [WITH options] 
-</​code>​ 
- 
-==== DROP DATABASE ==== 
- 
-The DROP DATABASE command drops a database from an Omnidex environment file. 
- 
-<​code>​ 
-DROP DATABASE [IF EXISTS] database IN "​filename"​ [WITH options] 
-</​code>​ 
- 
-==== DROP ENVIRONMENT ==== 
- 
-The DROP ENVIRONMENT command drops and deletes an Omnidex environment file. 
- 
-<​code>​ 
-DROP ENVIRONMENT [IF EXISTS] [environment] IN "​filename"​ [WITH options] 
-</​code>​ 
- 
-==== DROP INDEX ==== 
- 
-The DROP INDEX and DROP INDEX GROUP commands drop an index or index group from an Omnidex environment file. 
- 
-<​code>​ 
-DROP [<​OMNIDEX | NATIVE>] INDEX [IF EXISTS] [[(owner)]table.]index [ON table] 
-  IN "​filename"​ [WITH options] 
-</​code>​ 
- 
-<​code>​ 
-DROP INDEX GROUP [IF EXISTS] [(owner)]group IN "​filename"​ [WITH options] 
-</​code>​ 
- 
-==== DROP SEGMENT ==== 
- 
-The DROP SEGMENT command drops a segment that was previously created using the CREATE SEGMENT command. 
- 
-<​code>​ 
-DROP SEGMENT [IF EXISTS] segment [ON [INSTANCE] instance>​] [WITH options] 
-</​code>​ 
- 
-==== DROP TABLE ==== 
- 
-The DROP TABLE command drops a table that was previously created using the CREATE TABLE command. 
- 
-<​code>​ 
-DROP [<​TEMPORARY | PERMANENT>​] TABLE [IF EXISTS] table  
-  [<IN "​filename"​ | ON [INSTANCE] instance>​] [WITH options] 
-</​code>​ 
- 
-==== EDIT ==== 
- 
-The EDIT command launches an editor with the previously submitted command. ​ Upon exiting the editor, the command will be automatically executed. 
- 
-<​code>​ 
-EDIT [n | filename] [WITH options] 
-</​code>​ 
- 
-==== ERROR ==== 
- 
-The ERROR command displays the error message associated with an Omnidex error code. 
- 
-<​code>​ 
-ERROR error_code 
-</​code>​ 
- 
-==== EXIT ==== 
- 
-The EXIT command exits the OdxSQL program. 
- 
-<​code>​ 
-EXIT 
-</​code>​ 
- 
-==== EXPLAIN ==== 
- 
-The EXPLAIN command displays the query plan for the previously run query.  ​ 
- 
-<​code>​ 
-EXPLAIN [statement] [ON [CURSOR] cursor] [WITH options] 
-</​code>​ 
- 
-==== EXPORT ==== 
- 
-The EXPORT command exports the result of a SELECT statement into a raw data file or delimited file. 
- 
-<​code>​ 
-EXPORT [statement] TO filename [ON [CURSOR] cursor] [WITH options] 
-</​code>​ 
- 
-==== EXTRACT ==== 
- 
-The EXTRACT command extracts various types of statements from the currently-connected Omnidex environment file or from the system logs.  ​ 
- 
-<​code>​ 
-EXTRACT DDL [FOR <​ENVIRONMENT [environment] | DATABASE database>​] 
-  [TO filename] [ON [INSTANCE] instance] [WITH options] 
-EXTRACT DDL FOR <MYSQL | ORACLE | ODBC | SQLSERVER>​ 
-  [TO filename] [ON [INSTANCE] instance] [WITH options] 
-EXTRACT DML FOR table-list [WHERE criteria] 
-  [TO filename] [ON [INSTANCE] instance] [WITH options] 
-EXTRACT [<ALL | n | LONGEST n | ERRORING>​] QUERIES 
-  [BY <​CONNECTION | STATEMENT>​] [WHERE criteria] 
-  [TO filename] [ON [INSTANCE] instance] [WITH options] 
-</​code>​ 
- 
-==== FETCH ==== 
- 
-The FETCH command fetches individual rows following a SELECT statement. ​ The FETCH command is only needed if the SET AUTOFETCH OFF command is issued. 
- 
-<​code>​ 
-FETCH [<n | ALL>] [ON [CURSOR] cursor] [WITH options] 
-</​code>​ 
- 
-==== FOR ==== 
- 
-The FOR contruct provides a simple method for repeating one or more statements multiple times. 
- 
-<​code>​ 
-FOR n [WITH options] 
-<​statements>​ 
-END 
-</​code>​ 
- 
-==== FORMAT ==== 
- 
-The FORMAT command formats a file containing Omnidex SQL statements. 
- 
-<​code>​ 
-FORMAT input-file [INTO output-file] [WITH options] 
-</​code>​ 
- 
-==== HELP ==== 
- 
-The HELP command shows the commands available in OdxSQL. 
- 
-<​code>​ 
-HELP [<​command | SYNTAX | API>] 
-</​code>​ 
- 
-==== HISTORY ==== 
- 
-The HISTORY command shows a history of the commands previously entered in this session of OdxSQL. 
- 
-<​code>​ 
-HISTORY 
-</​code>​ 
- 
-==== IF ==== 
- 
-The IF contruct provides a simple method for IF/ELSE logic in OdxSQL. 
- 
-<​code>​ 
-IF condition 
-  <​statements>​ 
-ELIF condition 
-  <​statements>​ 
-ELSE 
-  <​statements>​ 
-ENDIF 
-</​code>​ 
- 
-==== INSERT ==== 
- 
-The INSERT command inserts data into a table. 
- 
-<​code>​ 
-INSERT INTO table [(column-list)] <VALUES (value-list) | select-stmt>​ 
-  [ON [INSTANCE] instance] [WITH options] 
-</​code>​ 
- 
-==== JOIN ==== 
- 
-The JOIN command performs an index join between two tables, and must follow a QUALIFY statement. 
- 
-<​code>​ 
-JOIN [FROM] table USING index TO [(owner)]table USING index 
-  [ON [CURSOR] cursor] [WITH options] 
-</​code>​ 
- 
-==== LOAD OFX ==== 
- 
-The LOAD OFX command loads Offset Indexes (OFX'​s) for any delimited files in the Omnidex environment. 
- 
-<​code>​ 
-LOAD OFX [FOR <​ENVIRONMENT [environment] | DATABASE database | TABLE table>] 
-  [ON [INSTANCE] instance] [WITH options] 
-</​code>​ 
- 
-==== OPEN CURSOR ==== 
- 
-The OPEN CURSOR command opens a suppplemental cursor for this connection. ​ The CONNECT statement automatically provides an initial cursor, so the OPEN CURSOR command is only needed if multiple cursors are required. 
- 
-<​code>​ 
-OPEN CURSOR [ON [INSTANCE] instance] [WITH options] 
-</​code>​ 
- 
-==== PARTITION ==== 
- 
-The PARTITION command partitions a table into multiple files in preparation for use in Omnidex Grids. 
- 
-<​code>​ 
-PARTITION table [INTO n] [BY <column | expression>​] [IN path] 
-  [ON [INSTANCE] instance] [WITH options] 
-</​code>​ 
- 
-==== PWD ==== 
- 
-The PWD command displays the current working directory. 
- 
-<​code>​ 
-PWD 
-</​code>​ 
- 
-==== QUALIFY ==== 
- 
-The QUALIFY command directly queries the Omnidex indexes, as a more granular alternative to issuing a SELECT statement.  ​ 
- 
-<​code>​ 
-QUALIFY [(owner)]table WHERE [[$QUALIFIED] <AND | OR> [NOT]] 
-  predicate [ON [CURSOR] cursor] [WITH options] 
-</​code>​ 
- 
-==== QUIT ==== 
- 
-The QUIT command exits the OdxSQL program. 
- 
-<​code>​ 
-QUIT 
-</​code>​ 
- 
-==== REGISTER LICENSE ==== 
- 
-The REGISTER LICENSE command registers a license code that has been received from the Omnidex licensing server. 
- 
-<​code>​ 
-REGISTER LICENSE license_code [FOR company] 
-</​code>​ 
- 
-==== REGISTER ODBC ==== 
- 
-The REGISTER ODBC command registers the ODBC driver for the current version of Omnidex. ​ This is done automatically when Omnidex is installed on the server. 
- 
-<​code>​ 
-REGISTER ODBC [dir] 
-</​code>​ 
- 
-==== REQUEST ==== 
- 
-The REQUEST command prompts for and sends a license request for this server. 
- 
-<​code>​ 
-REQUEST [<​ENTERPRISE | DEVELOPER | TRIAL>] LICENSE ​ 
-</​code>​ 
- 
-==== RESET HISTORY ==== 
- 
-The RESET HISTORY command clears the history of commands for this OdxSQL session. 
- 
-<​code>​ 
-RESET HISTORY 
-</​code>​ 
- 
-==== RESET TIMER ==== 
- 
-The RESET TIMER command resets the cumulative timer that was set using SET TIMER CUMULATIVE. 
- 
-<​code>​ 
-RESET TIMER 
-</​code>​ 
- 
-==== RESTORE SETTINGS ==== 
- 
-The RESTORE SETTINGS command restores the default settings for OdxSQL. ​ Alternatively,​ the RESTORE SETTINGS command loads the saved settings from a file created with the SAVE SETTINGS command. 
- 
-<​code>​ 
-RESTORE SETTINGS [[FROM] filename] [WITH options] 
-</​code>​ 
- 
-==== SAVE HISTORY ==== 
- 
-The SAVE HISTORY command saves the history of commands from this OdxSQL session into a file. 
- 
-<​code>​ 
-SAVE HISTORY [[TO] filename] [WITH options] 
-</​code>​ 
- 
-==== SAVE SETTINGS ==== 
- 
-The SAVE SETTINGS command saves the current OdxSQL settings to a file. 
- 
-<​code>​ 
-SAVE SETTINGS [[TO] filename] [WITH options] 
-</​code>​ 
- 
-==== SELECT ==== 
- 
-The SELECT command processes a SQL SELECT statement and displays the results. 
- 
-<​code>​ 
-SELECT statement [ON [CURSOR] cursor] [WITH options] 
-</​code>​ 
- 
-==== SET ==== 
- 
-The SET command sets an OdxSQL option. ​ See the [[programs:​odxsql:​options|Options section]] for a listing of OdxSQL options. 
- 
-<​code>​ 
-SET [<option | ?>] [ON <​INSTANCE | CURSOR> n] 
-</​code>​ 
- 
-==== SETENV ==== 
- 
-The SETENV command sets a system environment variable for the duration of this OdxSQL session. 
- 
-<​code>​ 
-SETENV variable value 
-</​code>​ 
- 
-==== SHOW ==== 
- 
-The SHOW command displays information about the current Omnidex environment or the Omnidex system. 
- 
-<​code>​ 
-SHOW <​ENVIRONMENT [environment] | DATABASE database | TABLE table | 
-  COLUMN column> [ON [INSTANCE] instance] [WITH options] 
-SHOW [<USER_ | DATA_ | METADATA_ | SYSTEM_ | ALL_>] 
-  <​DATABASES | TABLES | COLUMNS> 
-  [ON [INSTANCE] instance] [WITH options] 
-SHOW ALL [database] [ON [INSTANCE] instance] [WITH options] 
-SHOW <​INSTANCE | CURSOR> [object] [WITH options] 
-SHOW LICENSE 
-SHOW <​CONNECTIONS | STATEMENTS>​ [WITH options] 
-</​code>​ 
- 
-==== TRANSFER LICENSE ==== 
- 
-The TRANSFER LICENSE command initiates a transfer of this license to another server. 
- 
-<​code>​ 
-TRANSFER LICENSE 
-</​code>​ 
- 
-==== UNREGISTER ODBC ==== 
- 
-The UNREGISTER ODBC command unregisters the current ODBC driver. ​ This is not needed unless directed by DISC Technical Support. 
- 
-<​code>​ 
-UNREGISTER ODBC 
-</​code>​ 
- 
-==== UPDATE ==== 
- 
-The UPDATE command updates a row in a table. 
- 
-<​code>​ 
-UPDATE table SET column-assignments 
-  [WHERE <​predicate-list | CURRENT> [<ON | OF> [CURSOR] cursor]] 
-  [WITH options] 
-</​code>​ 
- 
-==== UPDATE INDEXES ==== 
- 
-The UPDATE INDEXES command rebuilds the Omnidex indexes for the current Omnidex environment. 
- 
-<​code>​ 
-UPDATE INDEXES [FOR <​ENVIRONMENT [environment] | DATABASE database | 
-  TABLE table | COLUMN table.column | INDEX table.index>​] 
-  [ON [INSTANCE] instance] [WITH options] 
-</​code>​ 
- 
-==== UPDATE ROLLUP ==== 
- 
-The UPDATE ROLLUP command rebuilds an individual rollup table declared in the Omnidex environment file. 
- 
-<​code>​ 
-UPDATE ROLLUP TABLE table [ON [INSTANCE] instance] [WITH options] 
-</​code>​ 
- 
-==== UPDATE ROLLUPS ==== 
- 
-The UPDATE ROLLUPS command rebuilds all rollup tables declared in the Omnidex environment file. 
- 
-<​code>​ 
-UPDATE ROLLUPS [FOR <​ENVIRONMENT [environment] | DATABASE database | 
-   TABLE table>] [ON [INSTANCE] instance] [WITH options] 
-</​code>​ 
- 
-==== UPDATE STATISTICS ==== 
- 
-The UPDATE STATISTICS command refreshes the statistics for the current Omnidex environment file.  This step is automatically done within an UPDATE INDEXES command. 
- 
-<​code>​ 
-UPDATE STATISTICS [FOR <​ENVIRONMENT [environment] | DATABASE database | 
-  TABLE table | COLUMN table.column | INDEX table.index>​] 
-  [ON [INSTANCE] instance] [WITH options] 
-</​code>​ 
- 
-==== UPDATE TEXT ==== 
- 
-The UPDATE TEXT command refreshes the PowerSearch dictionaries for the current Omnidex environment file.  This step is automatically done within an UPDATE INDEXES command. 
- 
-<​code>​ 
-UPDATE TEXT [FOR <​ENVIRONMENT [environment] | DATABASE database | 
-  TABLE table | COLUMN table.column | INDEX table.index>​] 
-  [ON [INSTANCE] instance] [WITH options] 
-</​code>​ 
- 
-==== USE ==== 
- 
-The USE command executes the statements within the named file.  See the [[programs:​odxsql:​files|Files section]] for more information. 
- 
-<​code>​ 
-USE filename [WHERE criteria] [WITH options] 
-</​code>​ 
- 
-==== VALIDATE ==== 
- 
-The VALIDATE command runs a series of tests to insure that an Omnidex environment is properly set up. 
- 
-<​code>​ 
-VALIDATE [<​ENVIRONMENT [environment] | DATABASE database | TABLE table>] 
-  [ON [INSTANCE] instance] [WITH options] 
-</​code>​ 
- 
- 
-==== ! ==== 
- 
-The '​!'​ command launches an interactive system shell from within OdxSQL. ​ If an operating system command is provided after the exclamation point, that command is issued without launching an interative system shell. 
- 
-<​code>​ 
-!<shell command> or ! for interactive shell 
-</​code>​ 
- 
-==== . ==== 
- 
-The '​.'​ command re-executes the last command. 
- 
-<​code>​ 
-<. | command number> 
-</​code>​ 
- 
-==== ; ==== 
- 
-The semicolon represents a command in OdxSQL. 
- 
-<​code>​ 
-; Comment ... 
-</​code>​ 
-  
-==== n ==== 
- 
-The '​n'​ command executes the numbered command from the OdxSQL history, shown using the HISTORY command. 
- 
-<​code>​ 
-   n (where n is a number from the command history) 
-</​code>​ 
- 
- 
-===== ===== 
- 
-**[[programs:​odxsql:​home|Prev]]** | **[[programs:​odxsql:​options|Next]]** |  
- 
-====== Additional Resources ====== 
- 
-See also:  
- 
-{{page>:​programs:​see_also&​nofooter&​noeditbtn}} 
- 
-{{page>:​bottom_add&​nofooter&​noeditbtn}} 
- 
- 
  
 
Back to top
programs/odxsql/commands.txt ยท Last modified: 2016/06/28 22:38 (external edit)