CREATE VIEW

From Recital Documentation Wiki
Revision as of 15:38, 10 November 2009 by Helengeorge (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Purpose

Activate the View Designer


Syntax

CREATE VIEW <filename> | (<expC>) [FROM ENVIRONMENT]


See Also

CREATE BRIDGE, CREATE SCREEN, DIALOG GET, FMT(), Function Keys, INDEX, MODIFY SCREEN, SET FORMAT, SET INDEX, SET ORDER, SET RELATION, SET VIEW, USE


Description

The CREATE VIEW command activates the full screen View Designer which is used to create a view file, which can be processed using the SET VIEW TO command. View files allow you to treat multiple tables and their associated files as a single object. Views are very useful for performing ad-hoc queries on data that is in multiple related tables.

<filename> | (<expC>)

The file name can be substituted with a <expC>, enclosed in round brackets, which returns a valid filename. If no file extension is specified, then '.vue' is used.

FROM ENVIRONMENT

If the optional FROM ENVIRONMENT clause is specified, a view file is automatically created for the established environment.

Without the FROM ENVIRONMENT clause, the CREATE VIEW command displays a screen for each workarea (1–10), prompting for the following details:


Field Description
Table The name of the table to be opened in this workarea
Alias The alias name for the table. By default this is the workarea letter A-J
Format The screen format file to be used. (CREATE SCREEN, SET FORMAT)
Index (1-7) The names of up to seven single index files (.ndx)
Filter The filter expression for the table
Relation to The name of a field in the current table used to link to another table
Into The name of the table that is the target of the relation


The menubar for the View Designer can be activated by pressing the [MENUBAR] key. The following options are available:


Menu Description
Workarea Displays a DIALOG GET to specify the workarea number (1-10) to select
Tables Displays a popup choicelist of tables in the current directory
Formats Displays a popup choicelist of screen format files in the current directory
Indexes Displays a popup choicelist of single index files in the current directory
Query Displays a popup query builder. This is used for constructing a filter expression
Help Displays the on-line help system


A specific view file can be opened directly using the SET VIEW TO <filename> command, or by creating a VIEW BRIDGE with the CREATE BRIDGE command then issuing the USE <view bridge> command.

All Recital products support the SQL CREATE VIEW command. This creates a logical view of one or more tables based on a SELECT statement. Please see the SQL documentation for further information.


Example

create view patrons
set view to patrons


Products

Recital