Difference between revisions of "SELECT"

From Recital Documentation Wiki
Jump to: navigation, search
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=SELECT=
 
 
 
==Class==
 
Table Basics
 
 
 
 
==Purpose==
 
==Purpose==
Select a workarea
+
Select a cursor
  
  
Line 15: Line 8:
  
 
==See Also==
 
==See Also==
[[USE]], [[ALIAS()]], [[SELECT ()]], [[WORKAREA()]], [[SET FILTER]], [[SET RELATION]], [[SET VIEW]]
+
[[ALIAS()]], [[SELECT()]], [[SET FILTER]], [[SET RELATION]], [[SET VIEW]], [[USE]], [[WORKAREA()]]  
  
  
 
==Description==
 
==Description==
The SELECT command is used to select a workarea.  By default Recital environments have 20 workareas.  At any given time, a particular workarea is active and selected.  The number of workareas may be configured up to the maximum supported by setting the environment variable / symbol [[DB_MAXWKA]].
+
The SELECT command is used to select a cursor.  At any given time, a particular cursor is active and selected.  When you USE a table in a selected cursor, an ALIAS name may be optionally specified.  If none is specified, the table basename can also be used as the alias as can the cursor letter A to Z.  The alias 'm' is reserved for memory variables and cannot be used to reference a cursor.  This ALIAS name gives the cursor an identification, so that you can reference fields in cursors other than the currently selected one, by preceding the field name with the ALIAS name followed by '->' or '.' followed by the field name.  This construction is known as an alias pointer.
 
+
The workareas are numbered 1 to 20 (or DB_MAXWKA) and can be selected by number.  When you USE a table in a selected workarea, an ALIAS name may be optionally specified.  If none is specified, the table basename can also be used as the alias as can the workarea letter A to T (up to Z if DB_MAXWKA is set higher).  The alias 'm' is reserved for memory variables and cannot be used to reference a workarea.  This ALIAS name gives the workarea an identification, so that you can reference fields in workareas other than the currently selected one, by preceding the field name with the ALIAS name followed by '->' or '.' followed by the field name.  This construction is known as an alias pointer.
+
  
Each workarea contains the context for the table that has been opened in that workarea.  The current record pointer, the current record, the format file, the index files, the filter condition, and the relationships to other workareas.  The SELECT 0 command selects the next available workarea and provides an alternative to using the WORKAREA() function.  The LIST STATUS command provides full details of the current status of each workarea.
+
Each cursor contains the context for the table that has been opened in that cursor.  The current record pointer, the current record, the format file, the index files, the filter condition, and the relationships to other workareas.  The SELECT 0 command selects the next available cursor and provides an alternative to using the WORKAREA() function.  The LIST STATUS command provides full details of the current status of each cursor.
  
  
Line 31: Line 22:
 
use patrons index events, dates alias pat
 
use patrons index events, dates alias pat
 
select b
 
select b
use addresses;
+
use addresses index addr_names alias add
index addr_names alias add
+
 
select pat
 
select pat
 
? add.state
 
? add.state
Line 39: Line 29:
  
 
==Products==
 
==Products==
Recital Database Server, Recital Mirage Server, Recital Terminal Developer
+
Recital Server, Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]
 +
[[Category:Table Basics]]
 +
[[Category:Table Basics Commands]]

Latest revision as of 11:23, 7 January 2010

Purpose

Select a cursor


Syntax

SELECT <workarea | alias>


See Also

ALIAS(), SELECT(), SET FILTER, SET RELATION, SET VIEW, USE, WORKAREA()


Description

The SELECT command is used to select a cursor. At any given time, a particular cursor is active and selected. When you USE a table in a selected cursor, an ALIAS name may be optionally specified. If none is specified, the table basename can also be used as the alias as can the cursor letter A to Z. The alias 'm' is reserved for memory variables and cannot be used to reference a cursor. This ALIAS name gives the cursor an identification, so that you can reference fields in cursors other than the currently selected one, by preceding the field name with the ALIAS name followed by '->' or '.' followed by the field name. This construction is known as an alias pointer.

Each cursor contains the context for the table that has been opened in that cursor. The current record pointer, the current record, the format file, the index files, the filter condition, and the relationships to other workareas. The SELECT 0 command selects the next available cursor and provides an alternative to using the WORKAREA() function. The LIST STATUS command provides full details of the current status of each cursor.


Example

select a
use patrons index events, dates alias pat
select b
use addresses index addr_names alias add
select pat
? add.state


Products

Recital Server, Recital