OSQL Select

PURPOSE:  OSQL SELECT displays records from a table to the screen.  The WITH WINDOW clause is required for DB-MACH2 and RMS, and will display a Screen Management Facility (SMF) window on the screen.  If the DEFINE PM clause is included, the Process Module (PM) created to execute the command will be saved in the current Data Base Library (DBL) under the object name specified.

Syntax

OSQL SELECT select_list FROM table_name

WITH WINDOW

[DEFINE PM process_module_name [ONLY]]

select_list

specifies the column names to be retrieved.  The list is composed of one or more column names (separated by commas) or an asterisk (*) that represents all columns in the order that they were specified when the table was created.

FROM  table_name

is the name of the table from which the records will be extracted.

WITH WINDOW

specifies that a window containing the columns from the table will be displayed on the screen.  The window uses the SMF window development language of ACCENT R.  This clause is required for DB-MACH2 and RMS.

DEFINE PM process_module_name

specifies that the PM containing the code generated to execute the OSQL command be saved and named as an object in the current DBL.  This PM is made up of ACCENT R PM statements and is useful for prototyping applications.

ONLY

specifies that the PM will be created without being executed by OSQL.  This clause is used primarily by the OSQL BUILD command but may also be used for on-line prototyping.  If the ONLY clause is included, the PM may be invoked interactively or from a Command Module (CM).

EXAMPLE

*OSQL SELECT * FROM NISDATA:BOOKS WITH WINDOW &
   DEFINE PM BOOKS_SELECT ONLY
*USE PM BOOKS_SELECT

SEE ALSO:  EXTRACT, SELECT, and REPORT