
C:\Program Files\Adobe\FrameMaker8\UniData 7.2\7.2rebranded\SQLREF\SQLRTITL.fm March 9, 2010 1:05 pm Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta UniData SQL Commands Reference UDT-720-SQLR-1 C:\Program Files\Adobe\FrameMaker8\UniData 7.2\7.2rebranded\SQLREF\SQLRTITL.fm March 9, 2010 1:05 pm Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Notices Edition Publication date: July 2008 Book number: UDT-720-SQLR-1 Product version: UniData 7.2 Copyright © Rocket Software, Inc. 1988-2008. All Rights Reserved. Trademarks The following trademarks appear in this publication: Trademark Trademark Owner Rocket Software™ Rocket Software, Inc. Dynamic Connect® Rocket Software, Inc. RedBack® Rocket Software, Inc. SystemBuilder™ Rocket Software, Inc. UniData® Rocket Software, Inc. UniVerse™ Rocket Software, Inc. U2™ Rocket Software, Inc. U2.NET™ Rocket Software, Inc. U2 Web Development Environment™ Rocket Software, Inc. wIntegrate® Rocket Software, Inc. Microsoft® .NET Microsoft Corporation Microsoft® Office Excel®, Outlook®, Word Microsoft Corporation Windows® Microsoft Corporation Windows® 7 Microsoft Corporation Windows Vista® Microsoft Corporation Java™ and all Java-based trademarks and logos Sun Microsystems, Inc. UNIX® X/Open Company Limited ii UniData SQL Commands Reference The above trademarks are property of the specified companies in the United States, other countries, or both. All other products or services mentioned in this document may be covered by the trademarks, service marks, or product names as designated by the companies who own or market them. License agreement This software and the associated documentation are proprietary and confidential to Rocket Software, Inc., are furnished under license, and may be used and copied only in accordance with the terms of such license and with the inclusion of the copyright notice. This software and any copies thereof may not be provided or otherwise made available to any other person. No title to or ownership of the software and associated documentation is hereby transferred. Any unauthorized use or reproduction of this software or documentation may be subject to civil or criminal liability. The information in the software and documentation is subject to change and should not be construed as a commitment by Rocket Software, Inc. Restricted rights notice for license to the U.S. Government: Use, reproduction, or disclosure is subject to restrictions as stated in the “Rights in Technical Data- General” clause (alternate III), in FAR section 52.222-14. All title and ownership in this computer software remain with Rocket Software, Inc. Note This product may contain encryption technology. Many countries prohibit or restrict the use, import, or export of encryption technologies, and current use, import, and export regulations should be followed when exporting this product. Please be aware: Any images or indications reflecting ownership or branding of the product(s) documented herein may or may not reflect the current legal ownership of the intellectual property rights associated with such product(s). All right and title to the product(s) documented herein belong solely to Rocket Software, Inc. and its subsidiaries, notwithstanding any notices (including screen captures) or any other indications to the contrary. Contact information Rocket Software 275 Grove Street Suite 3-410 Newton, MA 02466-2272 USA Tel: (617) 614-4321 Fax: (617) 630-7100 Web Site: www.rocketsoftware.com UniData SQL Commands Reference iii Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta Table of Contents Table of Contents Chapter 1 UniData SQL Commands Commands Summary . 1-3 UniData SQL Limitations . 1-7 ALTER TABLE . 1-8 AUTO COMMIT . 1-13 BREAK . 1-15 BTITLE . 1-18 CLEAR . 1-25 COLUMN . 1-26 COMMIT . 1-31 COMO . 1-33 COMPUTE . 1-36 CREATE INDEX . 1-40 CREATE SUBTABLE . 1-42 CREATE TABLE . 1-51 CREATE VIEW . 1-57 DELETE . 1-60 DROP INDEX . 1-63 DROP SUBTABLE . 1-64 DROP TABLE . 1-65 DROP VIEW . 1-67 EXIT . 1-69 GRANT . 1-70 INSERT . 1-73 LISTDICT . 1-77 LOCK TABLE . 1-78 QUIT . 1-80 REVOKE . 1-81 ROLLBACK . 1-83 SELECT . 1-84 SET . 1-102 SHOW . 1-113 :\Program Files\Adobe\FrameMaker8\UniData 7.2\7.2rebranded\SQLREF\SQLRTOC.fm (bookTOC.template) March 9 2010 1:05 pm SQL . 1-115 TTITLE . 1-116 UPDATE . 1-123 Adding Multivalues and Multi-Subvalues . 1-125 Examples . 1-127 Appendix A Defining Attributes Default Format and Conversion Codes . A-2 Attribute Name . A-3 Data Type. A-4 CHAR . A-4 DATE . A-5 NUMBER . A-5 LONG . A-6 Virtual Attributes (IDESC or VIRTUAL) . A-10 Location (LOC) . A-11 Display Name (DISP) . A-12 FORMAT. A-13 Value Code Specification . A-15 SM . A-15 Associating Attributes . A-16 Appendix B Unnesting Attributes Unnesting Associated Attributes . B-2 Sample Table for Unnesting Examples . B-2 Unnesting Associated Multivalued Attributes . B-4 Unnesting Associated Multi-Subvalued Attributes . B-5 Unnesting All Attributes in an Association. B-6 Unnesting Unassociated Attributes . B-8 Appendix C Creating Subtables Base Tables . C-2 T_CLIENTS . C-3 T_INVENTORY . C-4 T_ORDERS . C-5 CREATE SUBTABLE Examples . C-7 T_CLIENTS NL0 Subtables . C-7 T_CLIENTS NL1 Subtables . C-8 T_INVENTORY NL0 Subtable . C-9 T_INVENTORY NL1 Subtables . C-9 Table of Contents v T_ORDERS NL0 Subtables . C-13 T_ORDERS NL1 Subtables . C-14 T_ORDERS NL2 Subtables . C-18 Appendix D Arithmetic Functions and Operators Arithmetic Functions. D-2 Arithmetic Operators. D-3 vi UniData SQL Commands Reference UniData SQL Commands This chapter provides complete descriptions of all commands in the UniData imple- mentation of Structured Query Language (SQL). UniData SQL commands can be entered from the sql prompt or by encoding a series of SQL statements in an ASCII text file (UniData SQL script) with your system editor. You can then execute the script from the operating system prompt. This provides the capability of reusing a series of UniData SQL statements. 1-1 Elements of Syntax Statements This reference manual uses a common method for stating syntax for UniData commands. The syntax statement includes the command name, required arguments, and options that you can use with the command. Italics represents a variable that you can replace with any valid option. The following figure illustrates the elements of a syntax statement. command names square brackets indicate appear in boldface an optional argument no brackets or braces a vertical line indicates that indicates a required you may choose between argument the given arguments COMMAND required [option] [option1 | option2] {option1 | option2} required... "string" quotation marks must enclose a literal string braces indicate that you an ellipsis indicates that must choose between you may enter more than the given arguments one argument 1-2 UniData SQL Commands Reference Elements of UniData SQL Commands Summary Data Definition Language (DDL) Data definition language is also called “schema definition.” It uses table, indexing, view, and subtable commands. Table Commands: CREATE TABLE ALTER TABLE DROP TABLE Indexing Commands: CREATE INDEX DROP INDEX View Commands: CREATE VIEW DROP VIEW Subtable Commands: CREATE SUBTABLE DROP SUBTABLE Data Control Language (DCL) Data control language is also called “connection management.” It uses privilege and transaction processing commands. 1-3 Privilege Commands: GRANT REVOKE Transaction Processing Commands: AUTO COMMIT COMMIT ROLLBACK LOCK TABLE SET DISPLAY SET TRANSACTION Data Manipulation Language (DML) INSERT SELECT UPDATE DELETE Report Commands (RPT) TTITLE BTITLE COLUMN COMPUTE BREAK CLEAR SET SHOW Supplementary Commands (SUP) SQL 1-4 UniData SQL Commands Reference EXIT QUIT LISTDICT COMO 1-5 SELECT Statement Elements * ALL DISTINCT attributes functions expressions literals FROM UNNEST NL1, NL2, NL_ALL WHERE =, !=, <, <=, >, >=, <>, !<, !> EVERY subquery NOT IS [NOT] NULL [NOT] BETWEEN [NOT] IN [NOT] INTERSECT [NOT] LIKE %, _, ..., nA, nN, nX GROUP BY HAVING UNION ORDER BY TO INTO LPTR 1-6 UniData SQL Commands Reference UniData SQL Limitations In a SELECT statement, you cannot select more than 1000 attributes. All identifiers in UniData SQL, such as table_name, view_name, attribute_name, table_label, and all variables in OLD/NEW_VALUE of the COLUMN statement can be no longer than 30 characters. A UniData SQL statement cannot exceed 49 lines. The length of a single line of a UniData SQL statement, when used interactively, cannot exceed 272 characters. A single association cannot exceed 64 attributes. A table can contain a maximum of 12 associations. SELECT statement or clause cannot contain more than 255 virtual attributes. The IN predicate cannot contain more than five operators. Each operator must be a constant. The length of each constant cannot exceed 95 characters. Within a WHERE clause, the total number of predicates and Boolean operators cannot exceed 255. The ORDER BY clause can contain no more than nine elements (attribute names, expressions, and ordinal positions). The number of tables in the FROM clause of a SELECT statement is limited to 16. However, when performing a join, a new temporary table is created internally for every two joined tables in the FROM clause. Therefore, a join can contain no more than eight join tables, whereas a nested subquery with exactly one table at every level may contain up to 16 levels. The UNNEST clause can process 10,240 values in a multivalued or multi-subvalued attribute, or in all associations
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages189 Page
-
File Size-