Home

Getting Started

Utilities

Indexing

Omnidex

Development

Tutorials

Quick Links

 

Utilities

ODXSQL

Continuation Character

Comment Character

Re-execute Command

Execute System Command

 

ODXSQL

Special Characters

USE Files

Commands

Special Characters

Certain "special" characters entered at the ODXSQL command prompt have special meaning or cause specific behavior, as follows:

\ (back slash) - Continuation character - Used for formatting statements for readability.

; (semi-colon) - Comment character - Comment a line.

. (period) - Re-execute the last command.

n (history line number) - Re-execute a specific command from the command history.

! (exclamation point) - Execute an operating system command.

 

Continuation Character

For readability, the \ (back slash) continuation character can be used to continue a single statement on multiple lines. It can be used interactively or in use files.

Select prospects.acct, \
prospects.state \
from prospects \
where prospects.state = 'CA' and \
prospects.acct > 50

 

Comment Character

The ; (semi-colon) is a comment character that informs OdxSql that the rest of the current line will contain a comment, which is ignored. Directives can also be placed on the same line as a comment character, to control the state of OdxSQL.

The ; character is generally used in USE files but is also supported at the OdxSql command prompt.

; The text on this line is ignored. It is a comment.
; The text on the next line is a directive.
; <common>
...
; <end_common>

 

Execute a Previous Command

To re-execute the last command executed in OdxSql, enter a . (period) at the OdxSql command prompt and hit enter.

The help command is executed, displaying the help text about the Execute Previous Command special character:

>help .

.
Execute last command
Syntax:
< . | command number>

>

Next the help command is re-executed using the Execute Previous Command special character:

>.

.
Execute last command
Syntax:
< . | command number>

>

Another way to execute a previously executed command is to display a list of previously executed commands from the history file:

>history
1)help connect
2)help .
3)help .

Then enter the line number of the command you want to re-execute:

>2

.
Execute last command
Syntax:
< . | command number>

 

Execute System Commands

OdxSql supports the execution of operating system commands from within the running OdxSql program.

Omnidex does not provide any security for the execution of operating system commands, other than the standard operating system security.

Syntax

![os_command]

! (exclamation point)
Required.

os_command
Optional. Follow the exclamation point with a valid operating command to execute a single command.

If the exclamation point is executed by itself, os_command omitted, ODXSQL will switch to the operating system prompt. You can then execute a series of operating system commands. Enter 'exit' at the operating system prompt to return to ODXSQL.

 

The operating system prompt is governed by the SHELL environment variable. This defaults to DOS on a Windows machine, /bin/sh on Unix, ci.pub.sys on MPE/XL, and lib$spawn on VMS.

The ls and pwd commands executed in OdxSQL:

> !ls
ord.env
ord.in
ord.src
3 files in 1 directory 3722 bytes

> !pwd
/disc/orders

The ls and pwd commands executed from the operating system prompt reached through the ! command in OdxSQL:

> !

/disc/orders$ ls
ord.env ord.in ord.src

/disc/orders$ pwd
/disc/orders

/disc/orders$ exit
>

 

Top