This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
programs:odxsql:commands [2015/06/10 18:47] doc |
programs:odxsql:commands [2016/06/28 22:38] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
{{page>:top_add&nofooter&noeditbtn}} | {{page>:top_add&nofooter&noeditbtn}} | ||
+ | ~~NOTOC~~ | ||
====== Programs: OdxSQL ====== | ====== Programs: OdxSQL ====== | ||
- | @@programs:odxsql:home|Overview## | **@@programs:odxsql:commands|Commands##** | @@programs:odxsql:options|Options## | @@programs:odxsql:cmdline|Command-line## | @@programs:odxsql:files|Command Files## | + | [[programs:odxsql:home|Overview]] | **[[programs:odxsql:commands|Commands]]** | [[programs:odxsql:options|Options]] | [[programs:odxsql:cmdline|Command-line]] | [[programs:odxsql:files|Command Files]] |
Line 17: | Line 17: | ||
==== ATTACH DATABASE ==== | ==== ATTACH DATABASE ==== | ||
- | Attach a 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> | <code> | ||
Line 26: | Line 26: | ||
==== ATTACH SEGMENT ==== | ==== ATTACH SEGMENT ==== | ||
- | Attach a 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> | <code> | ||
Line 35: | Line 35: | ||
==== ATTACH TABLE ==== | ==== ATTACH TABLE ==== | ||
- | Attach a 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> | <code> | ||
Line 45: | Line 45: | ||
==== BENCHMARK ==== | ==== BENCHMARK ==== | ||
- | Perform performance benchmarks | + | The BENCHMARK command provides a menu of performance benchmarks that can be performed, focusing on POSIX file I/O. |
<code> | <code> | ||
Line 53: | Line 53: | ||
==== CALC ==== | ==== CALC ==== | ||
- | Perform basic calculator functions | + | The CALC command provides a very basic calculator, allowing formulas like "CALC (123+456)*789". |
<code> | <code> | ||
Line 61: | Line 61: | ||
==== CD ==== | ==== CD ==== | ||
- | Change directories | + | The CD command changes the current working directory within the OdxSQL session. The current working directory outside of OdxSQL remains unchanged. |
<code> | <code> | ||
Line 69: | Line 69: | ||
==== CLOSE CURSOR ==== | ==== CLOSE CURSOR ==== | ||
- | Close a cursor | + | The CLOSE CURSOR command closes a cursor that was previously opened using the OPEN CURSOR command. |
<code> | <code> | ||
- | CLOSE CURSOR @@ON] CURSOR] cursor] [WITH options] | + | CLOSE CURSOR [[ON] CURSOR] cursor] [WITH options] |
</code> | </code> | ||
==== CONNECT ==== | ==== CONNECT ==== | ||
- | Connect to an environment file | + | 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> | <code> | ||
Line 91: | Line 91: | ||
==== CONVERT ==== | ==== CONVERT ==== | ||
- | Export a file with data conversions | + | The CONVERT command allows a SELECT statement to be exported while interactively prompting for data conversions of each retrieved column. |
<code> | <code> | ||
Line 99: | Line 99: | ||
==== CREATE DATABASE ==== | ==== CREATE DATABASE ==== | ||
- | Create a 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> | <code> | ||
- | CREATE DATABASE database node [node ...] IN "filename" [WITH options] | + | CREATE DATABASE database |
+ | ... | ||
+ | IN "filename" [WITH options] | ||
</code> | </code> | ||
==== CREATE ENVIRONMENT ==== | ==== CREATE ENVIRONMENT ==== | ||
- | Create an environment file | + | The CREATE ENVIRONMENT command creates a new Omnidex environment file. |
<code> | <code> | ||
- | CREATE ENVIRONMENT environment [attribute [attribute ...## | + | CREATE ENVIRONMENT environment |
+ | [OPTIONS options] | ||
+ | [NODE node_declaration] | ||
+ | IN "filename" | ||
</code> | </code> | ||
==== CREATE INDEX ==== | ==== CREATE INDEX ==== | ||
- | Create an index or index group | + | 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> | <code> | ||
CREATE <OMNIDEX | QUICKTEXT | FULLTEXT | CUSTOM | NATIVE> INDEX | CREATE <OMNIDEX | QUICKTEXT | FULLTEXT | CUSTOM | NATIVE> INDEX | ||
- | @@(owner)]table.]index [ON table] | + | [[(owner)]table.]index [ON table] |
(<column | substring> [, <column | substring> ...])] | (<column | substring> [, <column | substring> ...])] | ||
- | [attribute [attribute ...## IN "filename" [WITH options] | + | [attribute [attribute ...]] IN "filename" [WITH options] |
CREATE INDEX GROUP [(owner)]group | CREATE INDEX GROUP [(owner)]group | ||
Line 130: | Line 135: | ||
==== CREATE SEGMENT ==== | ==== CREATE SEGMENT ==== | ||
- | Create a segment | + | The CREATE SEGMENT command creates a data segment or an index segment, thereby allowing it to be referenced in subsequent queries. |
<code> | <code> | ||
Line 140: | Line 145: | ||
==== CREATE TABLE ==== | ==== CREATE TABLE ==== | ||
- | Create a 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> | <code> | ||
Line 153: | Line 158: | ||
==== DATE ==== | ==== DATE ==== | ||
- | Show the current date and time | + | The DATE command shows the current date and time. |
<code> | <code> | ||
Line 161: | Line 166: | ||
==== DELETE ==== | ==== DELETE ==== | ||
- | Issue an SQL delete statement | + | The DELETE command deletes one or more rows from a table. |
<code> | <code> | ||
- | DELETE FROM table [WHERE < predicate-list | CURRENT> | + | DELETE FROM table [WHERE <predicate-list | CURRENT> |
- | [<ON | OF> [CURSOR] cursor## [WITH options] | + | [<ON | OF> [CURSOR] cursor]] [WITH options] |
</code> | </code> | ||
==== DETACH DATABASE ==== | ==== DETACH DATABASE ==== | ||
- | Detach a previously attached database | + | The DETACH DATABASE command detaches a database that was previously attached using the ATTACH DATABASE command. |
<code> | <code> | ||
Line 178: | Line 183: | ||
==== DETACH SEGMENT ==== | ==== DETACH SEGMENT ==== | ||
- | Detach a previously attached segment | + | The DETACH SEGMENT command detaches a segment that was previously attached using the ATTACH SEGMENT command. |
<code> | <code> | ||
Line 186: | Line 191: | ||
==== DETACH TABLE ==== | ==== DETACH TABLE ==== | ||
- | Detach a previously attached table | + | The DETACH TABLE command detaches a table that was previously attached using the ATTACH TABLE command. |
<code> | <code> | ||
Line 194: | Line 199: | ||
==== DIR ==== | ==== DIR ==== | ||
- | Display a directory of files | + | The DIR command lists the files named in the fileset, optionally showing details for each file. |
<code> | <code> | ||
Line 202: | Line 207: | ||
==== DISCONNECT ==== | ==== DISCONNECT ==== | ||
- | Disconnect from an environment file | + | The DISCONNECT command disconnects from the Omnidex environment file. |
<code> | <code> | ||
- | DISCONNECT [ALL] @@ON [INSTANCE## instance] [WITH options] | + | DISCONNECT [ALL] [[ON [INSTANCE]] instance] [WITH options] |
</code> | </code> | ||
==== DROP DATABASE ==== | ==== DROP DATABASE ==== | ||
- | Drop a database | + | The DROP DATABASE command drops a database from an Omnidex environment file. |
<code> | <code> | ||
Line 218: | Line 223: | ||
==== DROP ENVIRONMENT ==== | ==== DROP ENVIRONMENT ==== | ||
- | Drop an environment | + | The DROP ENVIRONMENT command drops and deletes an Omnidex environment file. |
<code> | <code> | ||
Line 226: | Line 231: | ||
==== DROP INDEX ==== | ==== DROP INDEX ==== | ||
- | Drop an index or index group | + | The DROP INDEX and DROP INDEX GROUP commands drop an index or index group from an Omnidex environment file. |
<code> | <code> | ||
- | DROP [<OMNIDEX | NATIVE>] INDEX [IF EXISTS] @@(owner)]table.]index [ON table] | + | DROP [<OMNIDEX | NATIVE>] INDEX [IF EXISTS] [[(owner)]table.]index [ON table] |
IN "filename" [WITH options] | IN "filename" [WITH options] | ||
</code> | </code> | ||
Line 239: | Line 244: | ||
==== DROP SEGMENT ==== | ==== DROP SEGMENT ==== | ||
- | Drop a segment | + | The DROP SEGMENT command drops a segment that was previously created using the CREATE SEGMENT command. |
<code> | <code> | ||
Line 247: | Line 252: | ||
==== DROP TABLE ==== | ==== DROP TABLE ==== | ||
- | Drop a table | + | The DROP TABLE command drops a table that was previously created using the CREATE TABLE command. |
<code> | <code> | ||
Line 256: | Line 261: | ||
==== EDIT ==== | ==== EDIT ==== | ||
- | Edit a previous command or file | + | The EDIT command launches an editor with the previously submitted command. Upon exiting the editor, the command will be automatically executed. |
<code> | <code> | ||
Line 264: | Line 269: | ||
==== ERROR ==== | ==== ERROR ==== | ||
- | Display an error message | + | The ERROR command displays the error message associated with an Omnidex error code. |
<code> | <code> | ||
Line 272: | Line 277: | ||
==== EXIT ==== | ==== EXIT ==== | ||
- | Exit Omnidex SQL | + | The EXIT command exits the OdxSQL program. |
<code> | <code> | ||
Line 280: | Line 285: | ||
==== EXPLAIN ==== | ==== EXPLAIN ==== | ||
- | Explain approach to retrieval | + | The EXPLAIN command displays the query plan for the previously run query. |
<code> | <code> | ||
Line 288: | Line 293: | ||
==== EXPORT ==== | ==== EXPORT ==== | ||
- | Export records to a file | + | The EXPORT command exports the result of a SELECT statement into a raw data file or delimited file. |
<code> | <code> | ||
Line 296: | Line 301: | ||
==== EXTRACT ==== | ==== EXTRACT ==== | ||
- | Extract SQL statements for database | + | The EXTRACT command extracts various types of statements from the currently-connected Omnidex environment file or from the system logs. |
<code> | <code> | ||
Line 312: | Line 317: | ||
==== FETCH ==== | ==== FETCH ==== | ||
- | Explicitly fetch data from a database | + | 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> | <code> | ||
Line 320: | Line 325: | ||
==== FOR ==== | ==== FOR ==== | ||
- | Form a 'FOR n ... END' construct | + | The FOR contruct provides a simple method for repeating one or more statements multiple times. |
<code> | <code> | ||
Line 330: | Line 335: | ||
==== FORMAT ==== | ==== FORMAT ==== | ||
- | Format a file of ODXSQL statements | + | The FORMAT command formats a file containing Omnidex SQL statements. |
<code> | <code> | ||
Line 338: | Line 343: | ||
==== HELP ==== | ==== HELP ==== | ||
- | Help | + | The HELP command shows the commands available in OdxSQL. |
<code> | <code> | ||
Line 346: | Line 351: | ||
==== HISTORY ==== | ==== HISTORY ==== | ||
- | Show history of ODXSQL commands | + | The HISTORY command shows a history of the commands previously entered in this session of OdxSQL. |
<code> | <code> | ||
Line 354: | Line 359: | ||
==== IF ==== | ==== IF ==== | ||
- | Form an 'IF ELIF ELSE ENDIF' construct | + | The IF contruct provides a simple method for IF/ELSE logic in OdxSQL. |
<code> | <code> | ||
Line 368: | Line 373: | ||
==== INSERT ==== | ==== INSERT ==== | ||
- | Issue an SQL insert statement | + | The INSERT command inserts data into a table. |
<code> | <code> | ||
Line 377: | Line 382: | ||
==== JOIN ==== | ==== JOIN ==== | ||
- | Join tables using Omnidex | + | The JOIN command performs an index join between two tables, and must follow a QUALIFY statement. |
<code> | <code> | ||
Line 386: | Line 391: | ||
==== LOAD OFX ==== | ==== LOAD OFX ==== | ||
- | Load indexes for a table | + | The LOAD OFX command loads Offset Indexes (OFX's) for any delimited files in the Omnidex environment. |
<code> | <code> | ||
Line 395: | Line 400: | ||
==== OPEN CURSOR ==== | ==== OPEN CURSOR ==== | ||
- | Open a 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> | <code> | ||
Line 403: | Line 408: | ||
==== PARTITION ==== | ==== PARTITION ==== | ||
- | Partition a table | + | The PARTITION command partitions a table into multiple files in preparation for use in Omnidex Grids. |
<code> | <code> | ||
Line 412: | Line 417: | ||
==== PWD ==== | ==== PWD ==== | ||
- | Print current working directory | + | The PWD command displays the current working directory. |
<code> | <code> | ||
Line 420: | Line 425: | ||
==== QUALIFY ==== | ==== QUALIFY ==== | ||
- | Qualify rows using Omnidex | + | The QUALIFY command directly queries the Omnidex indexes, as a more granular alternative to issuing a SELECT statement. |
<code> | <code> | ||
- | QUALIFY [(owner)]table WHERE @@$QUALIFIED] <AND | OR> [NOT## | + | QUALIFY [(owner)]table WHERE [[$QUALIFIED] <AND | OR> [NOT]] |
predicate [ON [CURSOR] cursor] [WITH options] | predicate [ON [CURSOR] cursor] [WITH options] | ||
</code> | </code> | ||
Line 429: | Line 434: | ||
==== QUIT ==== | ==== QUIT ==== | ||
- | Quit Omnidex SQL | + | The QUIT command exits the OdxSQL program. |
<code> | <code> | ||
Line 437: | Line 442: | ||
==== REGISTER LICENSE ==== | ==== REGISTER LICENSE ==== | ||
- | Register a license code | + | The REGISTER LICENSE command registers a license code that has been received from the Omnidex licensing server. |
<code> | <code> | ||
Line 445: | Line 450: | ||
==== REGISTER ODBC ==== | ==== REGISTER ODBC ==== | ||
- | Register an ODBC driver | + | 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> | <code> | ||
Line 453: | Line 458: | ||
==== REQUEST ==== | ==== REQUEST ==== | ||
- | Request a license code | + | The REQUEST command prompts for and sends a license request for this server. |
<code> | <code> | ||
Line 461: | Line 466: | ||
==== RESET HISTORY ==== | ==== RESET HISTORY ==== | ||
- | Reset history of ODXSQL commands | + | The RESET HISTORY command clears the history of commands for this OdxSQL session. |
<code> | <code> | ||
Line 469: | Line 474: | ||
==== RESET TIMER ==== | ==== RESET TIMER ==== | ||
- | Reset the cumulative timer | + | The RESET TIMER command resets the cumulative timer that was set using SET TIMER CUMULATIVE. |
<code> | <code> | ||
Line 477: | Line 482: | ||
==== RESTORE SETTINGS ==== | ==== RESTORE SETTINGS ==== | ||
- | Restore settings, optionally from a file | + | 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> | <code> | ||
- | RESTORE SETTINGS @@FROM] filename] [WITH options] | + | RESTORE SETTINGS [[FROM] filename] [WITH options] |
</code> | </code> | ||
==== SAVE HISTORY ==== | ==== SAVE HISTORY ==== | ||
- | Save commands to file | + | The SAVE HISTORY command saves the history of commands from this OdxSQL session into a file. |
<code> | <code> | ||
- | SAVE HISTORY [TO] filename] [WITH options] | + | SAVE HISTORY [[TO] filename] [WITH options] |
</code> | </code> | ||
==== SAVE SETTINGS ==== | ==== SAVE SETTINGS ==== | ||
- | Save settings, optionally to a file | + | The SAVE SETTINGS command saves the current OdxSQL settings to a file. |
<code> | <code> | ||
- | SAVE SETTINGS [TO] filename] [WITH options] | + | SAVE SETTINGS [[TO] filename] [WITH options] |
</code> | </code> | ||
==== SELECT ==== | ==== SELECT ==== | ||
- | Issue an SQL select statement | + | The SELECT command processes a SQL SELECT statement and displays the results. |
<code> | <code> | ||
Line 509: | Line 514: | ||
==== SET ==== | ==== SET ==== | ||
- | Set an option | + | The SET command sets an OdxSQL option. See the [[programs:odxsql:options|Options section]] for a listing of OdxSQL options. |
<code> | <code> | ||
Line 517: | Line 522: | ||
==== SETENV ==== | ==== SETENV ==== | ||
- | Set an environment variable | + | The SETENV command sets a system environment variable for the duration of this OdxSQL session. |
<code> | <code> | ||
Line 525: | Line 530: | ||
==== SHOW ==== | ==== SHOW ==== | ||
- | Describe an object | + | The SHOW command displays information about the current Omnidex environment or the Omnidex system. |
<code> | <code> | ||
Line 541: | Line 546: | ||
==== TRANSFER LICENSE ==== | ==== TRANSFER LICENSE ==== | ||
- | Transfer a license to another server | + | The TRANSFER LICENSE command initiates a transfer of this license to another server. |
<code> | <code> | ||
Line 549: | Line 554: | ||
==== UNREGISTER ODBC ==== | ==== UNREGISTER ODBC ==== | ||
- | Unregister an ODBC driver | + | The UNREGISTER ODBC command unregisters the current ODBC driver. This is not needed unless directed by DISC Technical Support. |
<code> | <code> | ||
Line 557: | Line 562: | ||
==== UPDATE ==== | ==== UPDATE ==== | ||
- | Issue an SQL update statement | + | The UPDATE command updates a row in a table. |
<code> | <code> | ||
UPDATE table SET column-assignments | UPDATE table SET column-assignments | ||
- | [WHERE <predicate-list | CURRENT> [<ON | OF> [CURSOR] cursor## | + | [WHERE <predicate-list | CURRENT> [<ON | OF> [CURSOR] cursor]] |
[WITH options] | [WITH options] | ||
</code> | </code> | ||
Line 567: | Line 572: | ||
==== UPDATE INDEXES ==== | ==== UPDATE INDEXES ==== | ||
- | Update Omnidex indexes | + | The UPDATE INDEXES command rebuilds the Omnidex indexes for the current Omnidex environment. |
<code> | <code> | ||
Line 577: | Line 582: | ||
==== UPDATE ROLLUP ==== | ==== UPDATE ROLLUP ==== | ||
- | Update rollup table | + | The UPDATE ROLLUP command rebuilds an individual rollup table declared in the Omnidex environment file. |
<code> | <code> | ||
Line 585: | Line 590: | ||
==== UPDATE ROLLUPS ==== | ==== UPDATE ROLLUPS ==== | ||
- | Update rollup tables | + | The UPDATE ROLLUPS command rebuilds all rollup tables declared in the Omnidex environment file. |
<code> | <code> | ||
Line 594: | Line 599: | ||
==== UPDATE STATISTICS ==== | ==== UPDATE STATISTICS ==== | ||
- | Update statistical information | + | The UPDATE STATISTICS command refreshes the statistics for the current Omnidex environment file. This step is automatically done within an UPDATE INDEXES command. |
<code> | <code> | ||
Line 604: | Line 609: | ||
==== UPDATE TEXT ==== | ==== UPDATE TEXT ==== | ||
- | Update textual statistics | + | 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> | <code> | ||
Line 614: | Line 619: | ||
==== USE ==== | ==== USE ==== | ||
- | Execute a file of ODXSQL commands | + | The USE command executes the statements within the named file. See the [[programs:odxsql:files|Files section]] for more information. |
<code> | <code> | ||
Line 622: | Line 627: | ||
==== VALIDATE ==== | ==== VALIDATE ==== | ||
- | Validate an environment | + | The VALIDATE command runs a series of tests to insure that an Omnidex environment is properly set up. |
<code> | <code> | ||
Line 632: | Line 637: | ||
==== ! ==== | ==== ! ==== | ||
- | Execute a shell command | + | 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> | <code> | ||
Line 640: | Line 645: | ||
==== . ==== | ==== . ==== | ||
- | Execute last command | + | The '.' command re-executes the last command. |
<code> | <code> | ||
Line 648: | Line 653: | ||
==== ; ==== | ==== ; ==== | ||
- | Comment line | + | The semicolon represents a command in OdxSQL. |
<code> | <code> | ||
Line 656: | Line 661: | ||
==== n ==== | ==== n ==== | ||
- | Execute numbered command | + | The 'n' command executes the numbered command from the OdxSQL history, shown using the HISTORY command. |
<code> | <code> | ||
Line 665: | Line 670: | ||
===== ===== | ===== ===== | ||
- | **@@programs:odxsql:home|Prev##** | **@@programs:odxsql:options|Next##** | | + | **[[programs:odxsql:home|Prev]]** | **[[programs:odxsql:options|Next]]** |
====== Additional Resources ====== | ====== Additional Resources ====== |