
Matisse® SQL Programmer’s Guide 19th Edition October 2005 Matissse SQL Programmer’s Guide Copyright ©1992–2005 Matisse Software Inc. All Rights Reserved. Matisse Software Inc. 433 Airport Blvd. Burlingame, CA 94010 USA Printed in USA. This manual and the software described in it are copyrighted. Under the copyright laws, this manual or the software may not be copied, in whole or in part, without prior written consent of Matisse Software Inc. This manual and the software described in it are provided under the terms of a license between Matisse Software Inc. and the recipient, and their use is subject to the terms of that license. RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the government is subject to restrictions as set forth in subparagraph (c)(l)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227- 7013 and FAR 52.227-19. The product described in this manual may be protected by one or more U.S. and international patents. TRADEMARKS: Matisse and the Matisse logo are registered trademarks of Matisse Software Inc. All other trademarks belong to their respective owners. PDF generated 25 September 2001 Contents Introduction . 10 Conventions . 10 1 SQL Query Analyzer and the mt_sql Utility . 11 1.1 SQL Query Analyzer . 11 1.2 Simple Example with mt_sql . 12 1.3 Basic Usage . 13 1.4 Command Line Options . 14 1.5 Online Help . 15 1.6 Discovering the Schema . 15 2 Constants and Identifiers . 17 2.1 What Is a Constant? . 17 Integer Constants . 17 Numeric Constants . 17 Real Constants . 18 Boolean Constants . 18 Character String Constants . 18 Date and Timestamp Constants . 19 Time Interval Constants . 20 Bytes Constants . 20 List Constants . 20 2.2 What Is an Identifier? . 21 2.3 Matisse SQL Reserved Words . 21 3 Selecting Data . 24 3.1 Using the SELECT Command . 24 Using the ONLY Keyword . 25 Specifying a SQL Projection . 25 OID, REF, and Relationship in SQL Projection . 26 Get a Successor at a Position in a Relationship . 27 CLASS_NAME and CLASS_ID. 27 3.2 Join Operation . 28 Natural Join . 29 Conditional Join. 29 Sorting the Result . 30 3.3 Using SQL Selections . 30 Create an SQL Selection. 30 Select from SQL Selections . 30 Selection Class . 31 Delete a Selection . 32 3.4 Specifying a Search Criteria with WHERE . 32 Contents 3 3.5 Using Attributes in Expressions . 33 Specifying an Attribute in a WHERE Clause . 33 3.6 Combining Predicates with AND and OR . 33 Precedence of Evaluation of AND and OR . 34 3.7 Specifying a Negative Condition with NOT . 35 3.8 Specifying a Type Predicate with IS OF . 35 3.9 Getting DISTINCT Values . 36 3.10 Specifying Sort Criteria with ORDER BY . 37 3.11 Grouping with GROUP BY and HAVING . 37 Grouping by class . 38 HAVING clause . 39 3.12 LIMIT and OFFSET . 39 3.13 Subqueries . 40 Subquery for Comparison . 40 Subquery used with IN. 41 Subquery with EXISTS . 41 4 Using Numeric Values . .43 4.1 Introduction . 43 4.2 Comparison Operators . 43 4.3 Performing Arithmetic Operations . 43 Expressions and Arithmetic Operators . 43 Evaluating an Expression: An Example. 44 4.4 Result Types from Arithmetic Expressions . 44 4.5 Performing an Interval Test . 46 4.6 Using the ANY and ALL Keywords . 46 5 Using Null Values . .47 5.1 Introduction . 47 5.2 What Is a Null Value? . 47 5.3 The IS NULL Keyword . 47 Example: Comparison with Null Values. 47 6 Using Text Values . .49 6.1 Introduction . 49 6.2 What Does Text Comparison Mean? . 49 6.3 What Is a Pattern? . 51 6.4 How to Use the % Wildcard Character . 51 6.5 How to Use the Underscore Wildcard Character . 52 6.6 Specifying a Pattern with the LIKE Keyword . 52 6.7 How to Use an Escape Character . 53 6.8 Using the ANY and ALL Keywords . 53 Quantified Comparison with the ANY Keyword . 54 Comparison with the ALL Keyword . 54 Equivalent Comparisons . 54 Alternate Syntax . 54 4 Matissse SQL Programmer’s Guide Examples. 55 6.9 Selecting Objects by Entry Points . 55 Exact Match Search . 55 Pattern Matching . 56 7 Using Relationships . 57 7.1 Introduction . 57 7.2 What Is a Relationship? . 57 7.3 Positional Access . 57 7.4 Navigational Queries . 58 Using a Single Relationship in the SELECT List . ..
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages136 Page
-
File Size-