Oracle Rdb7™ SQL Reference Manual Volume 3
Total Page:16
File Type:pdf, Size:1020Kb
Oracle Rdb7™ SQL Reference Manual Volume 3 Release 7.0 Part No. A42812-1 ® SQL Reference Manual, Volume 3 Release 7.0 Part No. A42812-1 Copyright © 1987, 1996, Oracle Corporation. All rights reserved. This software contains proprietary information of Oracle Corporation; it is provided under a license agreement containing restrictions on use and disclosure and is also protected by copyright law. Reverse engineering of the software is prohibited. The information contained in this document is subject to change without notice. If you find any problems in the documentation, please report them to us in writing. Oracle Corporation does not warrant that this document is error free. Restricted Rights Legend Programs delivered subject to the DOD FAR Supplement are ’commercial computer software’ and use, duplication and disclosure of the programs shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement. Otherwise, programs delivered subject to the Federal Acquisition Regulations are ’restricted computer software’ and use, duplication and disclosure of the programs shall be subject to the restrictions in FAR 52.227-14, Rights in Data—General, including Alternate III (June 1987). Oracle Corporation, 500 Oracle Parkway, Redwood City, CA 94065. The programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently dangerous applications. It shall be the licensee’s responsibility to take all appropriate fail-safe, back up, redundancy and other measures to ensure the safe use of such applications if the programs are used for such purposes, and Oracle disclaims liability for any damages caused by such use of the programs. Oracle is a registered trademark of Oracle Corporation. Oracle CDD/Administrator, Oracle CDD/Repository, Oracle Rally, Oracle Rdb, Oracle RMU, Oracle SQL/Services, Distributed Option for Rdb, Rdb Transparent Gateway to RMS, Rdb Transparent Gateway to DB2, Rdb Transparent Gateway to Oracle, and Rdb7 are trademarks of Oracle Corporation. All other product or company names mentioned are used for identification purposes only, and may be trademarks of their respective owners. Contents Send Us Your Comments ........................................... xi Preface ........................................................... xiii Technical Changes and New Features ............................... xvii 7 SQL Statements DELETE Statement ......................................... 7–2 DESCRIBE Statement ....................................... 7–7 DISCONNECT Statement . ................................. 7–15 DROP CATALOG Statement . ................................. 7–20 DROP COLLATING SEQUENCE Statement ...................... 7–22 DROP CONSTRAINT Statement ............................... 7–25 DROP DATABASE Statement ................................. 7–27 DROP DOMAIN Statement . ................................. 7–31 DROP INDEX Statement ..................................... 7–35 DROP MODULE Statement . ................................. 7–38 DROP OUTLINE Statement . ................................. 7–41 DROP PATHNAME Statement ................................ 7–42 Drop Routine Statement ..................................... 7–43 DROP SCHEMA Statement . ................................. 7–46 DROP STORAGE MAP Statement .............................. 7–49 DROP TABLE Statement ..................................... 7–52 DROP TRIGGER Statement . ................................. 7–58 DROP VIEW Statement ...................................... 7–61 EDIT Statement . ......................................... 7–64 END DECLARE Statement . ................................. 7–71 Execute ( @ ) Statement ...................................... 7–74 iii EXECUTE Statement . ...................................... 7–77 EXECUTE IMMEDIATE Statement ............................ 7–85 EXIT Statement ............................................ 7–90 EXPORT Statement . ...................................... 7–91 FETCH Statement .......................................... 7–96 FOR Control Statement ...................................... 7–105 GET DIAGNOSTICS Statement . .............................. 7–109 GRANT Statement .......................................... 7–114 GRANT Statement, ANSI/ISO-Style ............................ 7–133 HELP Statement ........................................... 7–144 IF Control Statement . ...................................... 7–146 IMPORT Statement . ...................................... 7–149 INCLUDE Statement . ...................................... 7–174 INSERT Statement . ...................................... 7–182 INTEGRATE Statement ...................................... 7–195 LEAVE Control Statement .................................... 7–214 LOOP Control Statement ..................................... 7–216 OPEN Statement ........................................... 7–219 Operating System Invocation ( $ ) Statement ...................... 7–224 PREPARE Statement . ...................................... 7–226 PRINT Statement .......................................... 7–236 QUIT Statement ........................................... 7–238 RELEASE Statement . ...................................... 7–239 RETURN Control Statement .................................. 7–243 REVOKE Statement . ...................................... 7–245 REVOKE Statement, ANSI/ISO-Style ........................... 7–255 ROLLBACK Statement ...................................... 7–263 SELECT Statement: General Form ............................. 7–265 SELECT Statement: Singleton Select ........................... 7–275 SET Statement ............................................ 7–278 SET ALIAS Statement . ...................................... 7–302 SET ALL CONSTRAINTS Statement ........................... 7–305 SET ANSI Statement . ...................................... 7–308 SET CATALOG Statement .................................... 7–311 SET CHARACTER LENGTH Statement . ...................... 7–316 SET CONNECT Statement ................................... 7–320 SET Control Statement ...................................... 7–324 iv SET DEFAULT CHARACTER SET Statement .................... 7–326 SET DEFAULT DATE FORMAT Statement ....................... 7–328 SET DIALECT Statement . ................................. 7–330 SET FLAGS Statement ...................................... 7–342 SET HOLD CURSORS Statement .............................. 7–349 SET IDENTIFIER CHARACTER SET Statement . ................ 7–352 SET KEYWORD RULES Statement . ......................... 7–354 SET LITERAL CHARACTER SET Statement ..................... 7–357 SET NAMES Statement ...................................... 7–359 SET NATIONAL CHARACTER SET Statement . ................ 7–362 SET OPTIMIZATION LEVEL Statement ......................... 7–364 SET QUOTING RULES Statement ............................. 7–368 SET SCHEMA Statement . ................................. 7–372 SET TRANSACTION Statement ............................... 7–376 SET VIEW UPDATE RULES Statement ......................... 7–401 SHOW Statement . ......................................... 7–405 Simple Statement . ......................................... 7–441 SIGNAL Control Statement . ................................. 7–443 TRACE Control Statement . ................................. 7–448 TRUNCATE TABLE Statement ................................ 7–451 UNDECLARE Variable Statement .............................. 7–454 UPDATE Statement ......................................... 7–455 WHENEVER Statement ..................................... 7–460 A Error Messages A.1 Types of Error Messages and Their Format ....................... A–1 A.2 Error Message Documentation ................................. A–3 A.3 Errors Generated When You Use SQL Statements . ................ A–4 A.4 Identifying Precompiler and Module Language Errors ............... A–8 A.5 sqlmsg.mdf - Error Message File for Digital UNIX . ................ A–8 v B The SQL Communications Area (SQLCA) and the Message Vector B.1 The SQLCA . .............................................. B–2 B.2 The Message Vector . ...................................... B–11 B.3 Declarations of the SQLCA and the Message Vector . ............. B–13 C SQLSTATE C.1 Definition of the SQLSTATE Status Parameter .................... C–2 C.2 Use of the SQLSTATE Status Parameter . ...................... C–4 D The SQL Dynamic Descriptor Areas (SQLDA and SQLDA2) D.1 Purpose of the SQLDA . ...................................... D–1 D.2 How SQL and Programs Use the SQLDA . ...................... D–3 D.3 Declaring the SQLDA . ...................................... D–5 D.4 Description of Fields in the SQLDA ............................. D–9 D.5 Parameters Associated with the SQLDA: SQLSIZE and SQLDAPTR . D–14 D.6 Purpose of the SQLDA2 ...................................... D–15 D.6.1 Declaring the SQLDA2 .................................... D–16 D.6.2 Description of Fields in the SQLDA2 . ...................... D–18 E Logical Names and Configuration Parameters Used by SQL F Obsolete SQL Syntax F.1 Incompatible Syntax . ...................................... F–1 F.1.1 Incompatible Syntax Containing the SCHEMA Keyword .......... F–2 F.1.1.1 CREATE SCHEMA Meaning Incompatible ................. F–2 F.1.1.2 SHOW SCHEMA Meaning Incompatible ................... F–2 F.1.1.3 DROP SCHEMA Meaning Incompatible ................... F–2 F.1.2 DROP TABLE Now Restricts by Default ...................... F–3 F.1.3 Database Handle Names