05/15/80 mrds.selection_expressions Function: This describes, in brief, the MRDS database query language, normally referred to as a selection expression. Syntax: -range (tuple_variable1 relation_name1) {... (tuple_variableN relation_nameN)} -select tuple_variable1.attr_name1 {... tuple_variable1.attr_nameN} . . tuple_variableN.attr_name1 {... tuple_variableN.attr_name} {-where {(((...} tuple_variable1.attr_name = tuple_variable2.attr_name { ) & . . tuple_variableN-1.attr_name = tuple_variableN.attr_name) } } Semantics: The range clause specifies which relations in the database will be involved in this query, and associates a tuple variable with each relation. There may be more than one tuple variable, if need be, per relation. The select clause specifies which attributes, in which relations, are to be selected, upon satisfaction of the where clause conditions. If only a tuple_variable is given, then all attributes in the corresponding relation are selected. The where clause specifies under what conditions, data is to be selected from the database. It is more general than shown, the = could be any of =, ^=, <, >, <=, >=. The & connector could have been |. A whole expression could have been negated by ^(expression). The comparisons can be against not only other tuple variable qualified attributes, but constants and expressions involving the arithmetic operators +, -, /, and *, as well as mrds builtin or user defined functions. Such expressions are enclosed in brackets, as in [tuple_variable.attr_name + 2], and can involve only one tuple variable per expression. Values can be substitued in place of a constant in the selection expression string, in the where clause comparisons, by using the symbol .V. in place of the constant, and then in the subroutine call, using a se_value in the argument list. Complicated where clauses can be built using parentheses for ordering of the evaluation. The where clause is optional, and if not given, all tuples in the range are selected. See the help file mrds.builtins.info. Exceptions: The range clause can have a .V. argument substitution in place of a relation name, in order to make use of a temporary relation index (not a relation name). The range clause may also have an option added after -range. These options are -print_search_order (-pso), and -no_optimize (-no_ot). They can be used to determine or produce an optimal data access search procedure. The select clause can have a -dup specified, to indicated that retrieved duplicates are not to be eliminated, which can improve efficiency, but can not be used with set operations. The select clause can have an asterisk following a attribute name, when defining a temporary relation, in order to specify a key attribute for the temporary relation. Individual selection expressions can be combined using set operations, for retrieves, when the results of each are union compatible results. The syntax is (se) set_op (se). Set_op may be one of -inter, -union, or -differ for set intersection, union, or difference. These set operations may be nested using parenthesis. When doing retrieves, the entire selection expression may be replaced by "-another" to retrieve subsequent tuples satisfying the selection expression that found the first tuple. Similarily, "-current tuple_variable1.attr_name 1 ... tuple_variable1.attr_nameN" can be used to reselect the same tuple previously selected, and is useful in conjunction with modifies and deletions, done after retrieves using -another. ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved