SQL Reference Volume 2 - Gordon College

1y ago
6 Views
1 Downloads
7.10 MB
883 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Carlos Cepeda
Transcription

DB2 DB2 Version 9 for Linux, UNIX, and Windows SQL Reference Volume 2 SC10-4250-00

DB2 DB2 Version 9 for Linux, UNIX, and Windows SQL Reference Volume 2 SC10-4250-00

Before using this information and the product it supports, be sure to read the general information under Notices. Edition Notice This document contains proprietary information of IBM. It is provided under a license agreement and is protected by copyright law. The information contained in this publication does not include any product warranties, and any statements provided in this manual should not be interpreted as such. You can order IBM publications online or through your local IBM representative. v To order publications online, go to the IBM Publications Center at www.ibm.com/shop/publications/order v To find your local IBM representative, go to the IBM Directory of Worldwide Contacts at www.ibm.com/ planetwide To order DB2 publications from DB2 Marketing and Sales in the United States or Canada, call 1-800-IBM-4YOU (426-4968). When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. Copyright International Business Machines Corporation 1993, 2006. All rights reserved. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

Contents About this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii Who should use this book . . . How this book is structured . . . A brief overview of Volume 1 . How to read the syntax diagrams Conventions used in this manual Error conditions . . . . . Highlighting conventions . . Related documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii . vii . vii . . . . . . . . . . . . . . . . . . . . . . . . . . . viii . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . x Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Supported SQL statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 How SQL statements are invoked . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Embedding a statement in an application program . . . . . . . . . . . . . . . . . . . . . 8 Dynamic preparation and execution . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Static invocation of a select-statement . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Dynamic invocation of a select-statement . . . . . . . . . . . . . . . . . . . . . . . . . 9 Interactive invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 SQL use with other host systems . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 SQL return codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 SQL comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 About SQL control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Function, method, and procedure designators . . . . . . . . . . . . . . . . . . . . . . . . 16 Function designator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Method designator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Procedure designator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 ALLOCATE CURSOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 ALTER BUFFERPOOL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 ALTER DATABASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 ALTER DATABASE PARTITION GROUP . . . . . . . . . . . . . . . . . . . . . . . . . 29 ALTER FUNCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 ALTER METHOD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 ALTER NICKNAME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 ALTER PROCEDURE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 ALTER SEQUENCE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 ALTER SERVER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 ALTER TABLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 ALTER TABLESPACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 ALTER TYPE (Structured) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 ALTER USER MAPPING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 ALTER VIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 ALTER WRAPPER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 ALTER XSROBJECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 ASSOCIATE LOCATORS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 BEGIN DECLARE SECTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 CALL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 CASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 CLOSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 COMMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 COMMIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 Compound SQL (Dynamic) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 Compound SQL (Embedded) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 Compound SQL (Procedure) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 CONNECT (Type 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 CONNECT (Type 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Copyright IBM Corp. 1993, 2006 iii

CREATE ALIAS . . . . . . . . . . . CREATE BUFFERPOOL . . . . . . . . CREATE DATABASE PARTITION GROUP . . CREATE DISTINCT TYPE . . . . . . . . CREATE EVENT MONITOR . . . . . . . CREATE FUNCTION . . . . . . . . . CREATE FUNCTION (External Scalar) . . . . CREATE FUNCTION (External Table) . . . . CREATE FUNCTION (OLE DB External Table) . CREATE FUNCTION (Sourced or Template) . . CREATE FUNCTION (SQL Scalar, Table, or Row) CREATE FUNCTION MAPPING . . . . . CREATE INDEX . . . . . . . . . . . CREATE INDEX EXTENSION . . . . . . CREATE METHOD . . . . . . . . . . CREATE NICKNAME . . . . . . . . . CREATE PROCEDURE . . . . . . . . . CREATE PROCEDURE (External) . . . . . CREATE PROCEDURE (Sourced) . . . . . CREATE PROCEDURE (SQL) . . . . . . . CREATE SCHEMA . . . . . . . . . . CREATE SECURITY LABEL . . . . . . . CREATE SECURITY LABEL COMPONENT . . CREATE SECURITY POLICY . . . . . . . CREATE SEQUENCE . . . . . . . . . CREATE SERVER . . . . . . . . . . . CREATE TABLE . . . . . . . . . . . CREATE TABLESPACE . . . . . . . . . CREATE TRANSFORM . . . . . . . . . CREATE TRIGGER . . . . . . . . . . CREATE TYPE (Structured) . . . . . . . CREATE TYPE MAPPING . . . . . . . . CREATE USER MAPPING . . . . . . . . CREATE VIEW . . . . . . . . . . . CREATE WRAPPER . . . . . . . . . . DECLARE CURSOR . . . . . . . . . . DECLARE GLOBAL TEMPORARY TABLE . . DELETE . . . . . . . . . . . . . . DESCRIBE . . . . . . . . . . . . . DISCONNECT . . . . . . . . . . . . DROP . . . . . . . . . . . . . . END DECLARE SECTION . . . . . . . . EXECUTE . . . . . . . . . . . . . EXECUTE IMMEDIATE . . . . . . . . EXPLAIN . . . . . . . . . . . . . FETCH . . . . . . . . . . . . . . FLUSH EVENT MONITOR . . . . . . . FLUSH PACKAGE CACHE . . . . . . . FOR . . . . . . . . . . . . . . . FREE LOCATOR . . . . . . . . . . . GET DIAGNOSTICS . . . . . . . . . . GOTO . . . . . . . . . . . . . . GRANT (Database Authorities) . . . . . . GRANT (Exemption) . . . . . . . . . GRANT (Index Privileges) . . . . . . . . GRANT (Package Privileges) . . . . . . . GRANT (Routine Privileges) . . . . . . . GRANT (Schema Privileges) . . . . . . . GRANT (Security Label) . . . . . . . . GRANT (Sequence Privileges) . . . . . . GRANT (Server Privileges) . . . . . . . iv SQL Reference Volume 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 185 189 191 197 214 215 239 256 263 272 281 285 301 307 313 325 326 339 344 350 353 355 358 360 364 368 433 447 454 465 489 495 497 511 513 518 526 533 537 540 568 569 575 578 584 587 588 589 592 593 596 598 602 604 606 609 613 616 618 620

GRANT (SETSESSIONUSER Privilege) . . . . . . . . . . . GRANT (Table Space Privileges) . . . . . . . . . . . . . GRANT (Table, View, or Nickname Privileges) . . . . . . . . GRANT (XSR object privileges) . . . . . . . . . . . . . IF . . . . . . . . . . . . . . . . . . . . . . . INCLUDE . . . . . . . . . . . . . . . . . . . . INSERT . . . . . . . . . . . . . . . . . . . . . ITERATE . . . . . . . . . . . . . . . . . . . . LEAVE . . . . . . . . . . . . . . . . . . . . . LOCK TABLE . . . . . . . . . . . . . . . . . . . LOOP . . . . . . . . . . . . . . . . . . . . . MERGE . . . . . . . . . . . . . . . . . . . . . OPEN . . . . . . . . . . . . . . . . . . . . . PREPARE . . . . . . . . . . . . . . . . . . . . REFRESH TABLE . . . . . . . . . . . . . . . . . . RELEASE (Connection) . . . . . . . . . . . . . . . . RELEASE SAVEPOINT . . . . . . . . . . . . . . . . RENAME . . . . . . . . . . . . . . . . . . . . RENAME TABLESPACE . . . . . . . . . . . . . . . REPEAT . . . . . . . . . . . . . . . . . . . . . RESIGNAL . . . . . . . . . . . . . . . . . . . . RETURN . . . . . . . . . . . . . . . . . . . . REVOKE (Database Authorities) . . . . . . . . . . . . . REVOKE (Exemption) . . . . . . . . . . . . . . . . REVOKE (Index Privileges) . . . . . . . . . . . . . . REVOKE (Package Privileges) . . . . . . . . . . . . . REVOKE (Routine Privileges) . . . . . . . . . . . . . . REVOKE (Schema Privileges) . . . . . . . . . . . . . . REVOKE (Security Label) . . . . . . . . . . . . . . . REVOKE (Sequence Privileges) . . . . . . . . . . . . . REVOKE (Server Privileges) . . . . . . . . . . . . . . REVOKE (SETSESSIONUSER Privilege) . . . . . . . . . . REVOKE (Table Space Privileges) . . . . . . . . . . . . REVOKE (Table, View, or Nickname Privileges) . . . . . . . . REVOKE (XSR object privileges) . . . . . . . . . . . . . ROLLBACK . . . . . . . . . . . . . . . . . . . SAVEPOINT . . . . . . . . . . . . . . . . . . . SELECT . . . . . . . . . . . . . . . . . . . . . SELECT INTO . . . . . . . . . . . . . . . . . . . SET COMPILATION ENVIRONMENT . . . . . . . . . . SET CONNECTION . . . . . . . . . . . . . . . . . SET CURRENT DEFAULT TRANSFORM GROUP . . . . . . . SET CURRENT DEGREE . . . . . . . . . . . . . . . SET CURRENT EXPLAIN MODE . . . . . . . . . . . . SET CURRENT EXPLAIN SNAPSHOT . . . . . . . . . . SET CURRENT FEDERATED ASYNCHRONY . . . . . . . . SET CURRENT IMPLICIT XMLPARSE OPTION . . . . . . . SET CURRENT ISOLATION . . . . . . . . . . . . . . SET CURRENT LOCK TIMEOUT . . . . . . . . . . . . SET CURRENT MAINTAINED TABLE TYPES FOR OPTIMIZATION SET CURRENT PACKAGE PATH . . . . . . . . . . . . SET CURRENT PACKAGESET . . . . . . . . . . . . . SET CURRENT QUERY OPTIMIZATION . . . . . . . . . . SET CURRENT REFRESH AGE . . . . . . . . . . . . . SET ENCRYPTION PASSWORD . . . . . . . . . . . . . SET EVENT MONITOR STATE . . . . . . . . . . . . . SET INTEGRITY . . . . . . . . . . . . . . . . . . SET PASSTHRU . . . . . . . . . . . . . . . . . . SET PATH . . . . . . . . . . . . . . . . . . . . SET SCHEMA . . . . . . . . . . . . . . . . . . . SET SERVER OPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622 624 626 633 634 636 638 647 648 650 652 654 663 668 677 680 682 683 685 686 688 690 692 696 697 699 702 705 707 708 710 712 714 716 721 722 725 728 729 731 733 735 737 739 742 745 747 748 749 751 753 757 759 762 764 765 767 785 787 789 791 Contents v

SET SESSION AUTHORIZATION SET Variable . . . . . . . SIGNAL . . . . . . . . . TRANSFER OWNERSHIP . . . UPDATE . . . . . . . . . VALUES . . . . . . . . . VALUES INTO . . . . . . WHENEVER . . . . . . . WHILE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793 796 801 804 818 829 830 832 834 Appendix A. DB2 Database technical information . . . . . . . . . . . . . . . . . 837 Overview of the DB2 technical information . . . . . . . . . . . . . . Documentation feedback . . . . . . . . . . . . . . . . . . . DB2 technical library in hardcopy or PDF format . . . . . . . . . . . . Ordering printed DB2 books . . . . . . . . . . . . . . . . . . . Displaying SQL state help from the command line processor . . . . . . . . Accessing different versions of the DB2 Information Center . . . . . . . . . Displaying topics in your preferred language in the DB2 Information Center . . . Updating the DB2 Information Center installed on your computer or intranet server DB2 tutorials . . . . . . . . . . . . . . . . . . . . . . . . DB2 troubleshooting information . . . . . . . . . . . . . . . . . . Terms and Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 837 837 838 840 841 842 842 843 845 845 846 Appendix B. Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847 Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 849 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 851 Contacting IBM vi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 865 SQL Reference Volume 2

About this book The SQL Reference in its two volumes defines the SQL language used by DB2 Database for Linux , UNIX , and Windows . It includes: v Information about relational database concepts, language elements, functions, and the forms of queries (Volume 1). v Information about the syntax and semantics of SQL statements (Volume 2). Who should use this book This book is intended for anyone who wants to use the Structured Query Language (SQL) to access a database. It is primarily for programmers and database administrators, but it can also be used by those who access databases through the command line processor (CLP). This book is a reference rather than a tutorial. It assumes that you will be writing application programs and therefore presents the full functions of the database manager. How this book is structured This book contains information about the following major topics: v “Statements,” on page 1 contains syntax diagrams, semantic descriptions, rules, and examples of all SQL statements, including SQL procedure statements. A brief overview of Volume 1 The first volume of the SQL Reference contains information about relational database concepts, language elements, functions, and the forms of queries. The specific chapters and appendixes in that volume are briefly described here. v “Concepts” discusses the basic concepts of relational databases and SQL. v “Language elements” describes the basic syntax of SQL and the language elements that are common to many SQL statements. v “Functions” contains syntax diagrams, semantic descriptions, rules, and usage examples of SQL column and scalar functions. v “Procedures” contains syntax diagrams, semantic descriptions, rules, and usage examples of procedures. v “Queries” describes the various forms of a query. v “SQL limits” lists the SQL limitations. v “SQLCA (SQL communications area)” describes the SQLCA structure. v “SQLDA (SQL descriptor area)” describes the SQLDA structure. v “Catalog views” describes the system catalog views. v “Federated systems” describes options and type mappings for federated systems. v “The SAMPLE database and SQL Reference examples” introduces the SAMPLE database, which contains the tables that are used in many examples. v “Reserved schema names and reserved words” contains the reserved schema names and the reserved words for the IBM SQL and ISO/ANSI SQL99 and SQL2003 standards. Copyright IBM Corp. 1993, 2006 vii

A brief overview of Volume 1 v “Interaction of triggers and constraints” discusses the interaction of triggers and referential constraints. v “Explain tables” describes the explain tables. v “Explain register values” describes the interaction of the CURRENT EXPLAIN MODE and CURRENT EXPLAIN SNAPSHOT special register values with each other and with the PREP and BIND commands. v “Exception tables” contains information about user-created tables that are used with the SET INTEGRITY statement. v “SQL statements allowed in routines” lists the SQL statements that are allowed to execute in routines with different SQL data access contexts. v “CALL” describes the CALL statement that can be invoked from a compiled statement. v “Japanese and traditional-Chinese EUC considerations” lists considerations when using extended UNIX code (EUC) character sets. v “BNF specifications for DATALINKs” contains the Backus-Naur form (BNF) specifications for DATALINKs. How to read the syntax diagrams Throughout this book, syntax is described using the structure defined as follows: Read the syntax diagrams from left to right and top to bottom, following the path of the line. The symbol indicates the beginning of a syntax diagram. The symbol indicates that the syntax is continued on the next line. The symbol indicates that the syntax is continued from the previous line. The symbol indicates the end of a syntax diagram. Syntax fragments start with the symbol and end with the symbol. Required items appear on the horizontal line (the main path). required item Optional items appear below the main path. required item optional item If an optional item appears above the main path, that item has no effect on execution, and is used only for readability. optional item required item If you can choose from two or more items, they appear in a stack. viii SQL Reference Volume 2

How to read the syntax diagrams If you must choose one of the items, one item of the stack appears on the main path. required item required choice1 required choice2 If choosing one of the items is optional, the entire stack appears below the main path. required item optional choice1 optional choice2 If one of the items is the default, it will appear above the main path, and the remaining choices will be shown below. default choice required item optional choice optional choice An arrow returning to the left, above the main line, indicates an item that can be repeated. In this case, repeated items must be separated by one or more blanks. required item repeatable item If the repeat arrow contains a comma, you must separate repeated items with a comma. , required item repeatable item A repeat arrow above a stack indicates that you can make more than one choice from the stacked items or repeat a single choice. Keywords appear in uppercase (for example, FROM). They must be spelled exactly as shown. Variables appear in lowercase (for example, column-name). They represent user-supplied names or values in the syntax. If punctuation marks, parentheses, arithmetic operators, or other such symbols are shown, you must enter them as part of the syntax. Sometimes a single variable represents a larger fragment of the syntax. For example, in the following diagram, the variable parameter-block represents the whole syntax fragment that is labeled parameter-block: required item parameter-block About this book ix

How to read the syntax diagrams parameter-block: parameter1 parameter2 parameter3 parameter4 Adjacent segments occurring between “large bullets” (*) may be specified in any sequence. required item item1 * item2 * item3 * item4 The above diagram shows that item2 and item3 may be specified in either order. Both of the following are valid: required item item1 item2 item3 item4 required item item1 item3 item2 item4 Conventions used in this manual This section specifies some conventions that are used consistently throughout this manual. Error conditions An error condition is indicated within the text of the manual by listing the SQLSTATE associated with the error in parentheses. For example: A duplicate signature returns an SQL error (SQLSTATE 42723). Highlighting conventions The following conventions are used in this book. Bold Indicates commands, keywords, and other items whose names are predefined by the system. Italics Indicates one of the following: v Names or values (variables) that must be supplied by the user v General emphasis v The introduction of a new term v A reference to another source of information Monospace Indicates one of the following: v Files and directories v Information that you are instructed to type at a command prompt or in a window v Examples of specific data values v Examples of text similar to what might be displayed by the system v Examples of system messages Related documentation The following publications might prove useful when you are preparing applications: v Administration Guide x SQL Reference Volume 2

Related documentation v v v v v – Contains information required to design, implement, and maintain a database that is to be accessed either locally or in a client/server environment Getting Started with Database Application Development – Provides an introduction to DB2 application development, including platform prerequisites; supported development software; and guidance on the benefits and limitations of the supported programming APIs. Developing SQL and External Routines – Contains information that explains how to design and create databases and database objects including tables, constraints, triggers, views, and user-defined SQL stored procedures and functions. It also explains how to query and modify data, and how to control access to database objects. DB2 Universal Database for iSeries SQL Reference – This book defines SQL as supported by DB2 Query Manager and SQL Development Kit on iSeries (AS/400 ). It contains reference information for the tasks of system administration, database administration, application programming, and operation. This manual includes syntax, usage notes, keywords, and examples for each of the SQL statements used on iSeries (AS/400) systems running DB2. DB2 Universal Database for z/OS and OS/390 SQL Reference – This book defines SQL used in DB2 for z/OS (OS/390). It provides query forms, SQL statements, SQL procedure statements, DB2 limits, SQLCA, SQLDA, catalog tables, and SQL reserved words for z/OS systems running DB2. DB2 Spatial Extender User’s Guide and Reference – This book discusses how to write applications to create and use a geographic information system (GIS). Creating and using a GIS involves supplying a database with resources and then querying the data to obtain information such as locations, distances, and distributions within areas. v IBM SQL Reference – This book contains all the common elements of SQL that span IBM’s database products. It provides limits and rules that assist in preparing portable programs using IBM databases. This manual provides a list of SQL extensions and incompatibilities among the following standards and products: SQL92E, XPG4-SQL, IBM-SQL, and the IBM relational database products. v American National Standard X3.135-1992, Database Language SQL – Contains the ANSI standard definition of SQL. v ISO/IEC 9075:1992, Database Language SQL – Contains the 1992 ISO standard definition of SQL. v ISO/IEC 9075-2:1999, Database Language SQL -- Part 2: Foundation (SQL/Foundation) – Contains a large portion of the 1999 ISO standard definition of SQL. v ISO/IEC 9075-4:1999, Database Language SQL -- Part 4: Persistent Stored Modules (SQL/PSM) – Contains the 1999 ISO standard definition for SQL procedure control statements. v ISO/IEC 9075-5:1999, Database Language SQL -- Part 4: Host Language Bindings (SQL/Bindings) – Contains the 1999 ISO standard definition for host language bindings and dynamic SQL. About this book xi

Related documentation xii SQL Reference Volume 2

Statements This chapter contains syntax diagrams, semantic descriptions, rules, and examples of the use of the SQL statements, including the statements that constitute the body of an SQL routine, trigger, or dynamic compound statement. Supported SQL statements The following tables list the supported SQL statements classified by type: v SQL schema statements (Table 1) v SQL data change statements (Table 2 on page 4) v SQL data statements (Table 3 on page 4) v SQL transaction statements (Table 4 on page 5) v SQL connection statements (Table 5 on page 5) v SQL dynamic statements (Table 6 on page 5) v SQL session statements (Table 7 on page 5) v SQL embedded host language statements (Table 8 on page 6) v SQL control statements (Table 9 on page 7) Table 1. SQL schema statements SQL Statement Purpose “ALT

DB2 Database technical information. 837 Overview of the DB2 technical information. 837 Documentation feedback. . 837 DB2 technical library in hardcopy or PDF . SET INTEGRITY statement. v "SQL statements allowed in

Related Documents:

SQL Server supports ANSI SQL, which is the standard SQL (Structured Query Language) language. However, SQL Server comes with its own implementation of the SQL language, T-SQL (Transact- SQL). T-SQL is a Microsoft propriety Language known as Transact-SQL. It provides further capab

MS SQL Server: MS SQL Server 2017, MS SQL Server 2016, MS SQL Server 2014, MS SQL Server 2012, MS SQL Server 2008 R2, 2008, 2008 (64 bit), 2008 Express, MS SQL Server 2005, 2005 (64 bit), 2005 Express, MS SQL Server 2000, 2000 (64 bit), 7.0 and mixed formats. To install the software, follow the steps: 1. Double-click Stellar Repair for MS SQL.exe.

Server 2005 , SQL Server 2008 , SQL Server 2008 R2 , SQL Server 2012 , SQL Server 2014 , SQL Server 2005 Express Edition , SQL Server 2008 Express SQL Server 2008 R2 Express , SQL Server 2012 Express , SQL Server 2014 Express .NET Framework 4.0, .NET Framework 2.0,

70 Microsoft SQL Server 2008: A Beginner’s Guide SQL_2008 / Microsoft SQL Server 2008: ABG / Petkovic / 154638-3 / Chapter 4 In Transact-SQL, the use of double quotation marks is defined using the QUOTED_ IDENTIFIER option of the SET statement. If this option is set to ON, which is theFile Size: 387KBPage Count: 26Explore furtherLanguage Elements (Transact-SQL) - SQL Server Microsoft Docsdocs.microsoft.comThe 33 languages of SQL Server Joe Webb Blogweblogs.sqlteam.comThe Language of SQL Pdf - libribooklibribook.comSql And The Standard Language For Relational Database .www.bartleby.comdatabase - What are good alternatives to SQL (the language .stackoverflow.comRecommended to you based on what's popular Feedback

Use \i FULL_PATH_ass1.sql to load your ass1.sql where FULL_PATH_ass1.sql is the full path of your answer file (ass1.sql) Use \i FULL_PATH_check1.sql to load check1.sql where FULL_PATH_check1.sql is the full path of the check file (check1.sql) reate a new database for mymy2 database. Repeat the above steps using mymy2.dump and check2.sql

SQL Server 2005 SQL Server 2008 (New for V3.01) SQL Server 2008 R2 (New for V3.60) SQL Server 2012 (New for V3.80) SQL Server 2012 R2 (New for V3.95) SQL Server 2014 (New for V3.97) SQL Server 2016 (New for V3.98) SQL Server 2017 (New for V3.99) (Recommend Latest Service Pack) Note: SQL Server Express is supported for most situations. Contact .

Logical SQL statements understood by the Oracle BI Server. Logical SQL includes standard SQL, plus special functions (SQL extensions) such as AGO, TODATE, EVALUATE, and others. Logical SQL queries resolve to Presentation layer objects. This guide contains the following topics: About Logical SQL in Oracle Business Intelligence SQL Syntax .

4395 querying data with transact -sql (m20761) microsoft sql server 6552 querying microsoft sql server 2014 (m20461) microsoft sql server 1833 sql server performance tuning and optimization (m55144) microsoft sql server 4394 updating your skills to sql server 2016 (m10986) microsoft sql server