Activate the View Designer
CREATE VIEW <filename> | (<expC>) [FROM ENVIRONMENT]
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.
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:
|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:
|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.
create view patrons set view to patrons