Progress
SQL-92
Guide and Reference


Running a Single SQL-92 Statement

Once SQL Explorer is connected to a database you can execute any SQL-92 statement.

Comment Lines

SQL Explorer recognizes the pound sign ( # ) or double dashes ( -- ) as comment lines in input files, as well as interactively. For a line to be treated as a comment line, one of these comment identifiers must be the first text in the line. The identifier can be in any column. SQL Explorer treats all text in the line after the comment identifier as a comment.

Character Mode

A semicolon ( ; ) is required to indicate the end of a statement, and signal SQL Explorer to execute a single SQL-92 statement. When you execute a SQL statement the output displays to standard output. You can use the -outfile startup parameter to redirect the output to a file that you specify.

Use the following syntax to execute a SQL-92 statement from the SQL Explorer command prompt:

SYNTAX
SQLExplorer> SQL_92_statement ; 

To query the y2ksports database for the contents of the item table with owner PUB, enter this statement at the SQL Explorer command prompt:

-- Selecting all rows from the item table, with owner pub

select * from pub.item; 

Windows

When you run a single SQL-92 statement the output is displayed in table format in the bottom pane. You can use the File Toggle Table Format option or the CTRL-T accelerator key to disable the table format.

Follow these steps to execute a SQL-92 statement from the SQL Explorer window:

  1. Type the SQL-92 statement in the top pane.
  2. Click the Execute button. The output displays in the bottom pane.
NOTE: When executing a single statement in the Windows version the semicolon ( ; ) is optional. Clicking the Execute button signals SQL Explorer to execute the statement.

EXAMPLE

To query the y2ksports database for all columns in the customer table with owner PUB, type the following SQL-92 statement in the top pane of the SQL Explorer window, then click Run:

-- Selecting all rows from the customer table with owner pub.

select * from pub.customer; 

The output of the query appears in the bottom pane.

To execute the GRANT statement and grant DBA privileges to a specific user, type the GRANT DBA statement in the top pane, then click the Execute button.

NOTE: For SQL-92 statements that produce no output the execution status displays in the single-line message area at the bottom of the SQL Explorer window.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095