Derby Reference Manual Version 10.15
Total Page:16
File Type:pdf, Size:1020Kb
Derby Reference Manual Version 10.15 Derby Document build: February 4, 2020, 5:03:53 PM (PST) Version 10.15 Derby Reference Manual Contents Copyright..............................................................................................................................11 License................................................................................................................................. 12 About this guide..................................................................................................................16 Purpose of this document...................................................................................... 16 Audience................................................................................................................... 16 How this guide is organized...................................................................................16 SQL syntax used in this manual............................................................................17 SQL language reference.....................................................................................................18 Capitalization and special characters....................................................................18 SQL identifiers ........................................................................................................ 18 Rules for SQL identifiers..................................................................................... 19 SQLIdentifier........................................................................................................ 19 aggregateName................................................................................................... 20 authorizationIdentifier...........................................................................................20 columnName........................................................................................................20 constraintName....................................................................................................21 correlationName...................................................................................................21 cursorName......................................................................................................... 21 functionName.......................................................................................................22 indexName...........................................................................................................22 newTableName....................................................................................................22 procedureName................................................................................................... 23 roleName............................................................................................................. 23 schemaName.......................................................................................................23 sequenceName....................................................................................................24 simpleColumnName.............................................................................................24 synonymName..................................................................................................... 24 tableName............................................................................................................24 triggerName......................................................................................................... 25 typeName.............................................................................................................25 viewName............................................................................................................ 25 Statements................................................................................................................ 26 Interaction with the dependency system.............................................................26 ALTER TABLE statement....................................................................................27 CALL (PROCEDURE) statement........................................................................ 32 CREATE statements........................................................................................... 33 DECLARE GLOBAL TEMPORARY TABLE statement....................................... 57 DELETE statement..............................................................................................60 DROP statements................................................................................................60 GRANT statement............................................................................................... 64 INSERT statement...............................................................................................67 LOCK TABLE statement..................................................................................... 69 MERGE statement ............................................................................................. 70 RENAME statements...........................................................................................73 REVOKE statement ............................................................................................74 SELECT statement..............................................................................................78 SET statements................................................................................................... 80 TRUNCATE TABLE statement............................................................................84 UPDATE statement............................................................................................. 84 SQL clauses............................................................................................................. 85 i Version 10.15 Derby Reference Manual CONSTRAINT clause..........................................................................................85 EXTERNAL NAME clause...................................................................................93 FOR UPDATE clause..........................................................................................94 FROM clause.......................................................................................................95 GROUP BY clause..............................................................................................95 HAVING clause................................................................................................... 96 WINDOW clause................................................................................................. 97 ORDER BY clause.............................................................................................. 97 The result offset and fetch first clauses.............................................................. 99 USING clause....................................................................................................100 WHERE clause..................................................................................................100 WHERE CURRENT OF clause.........................................................................101 SQL expressions....................................................................................................102 selectExpression................................................................................................105 tableExpression................................................................................................. 107 NEXT VALUE FOR expression.........................................................................108 VALUES expression.......................................................................................... 109 Expression precedence..................................................................................... 111 Boolean expressions......................................................................................... 111 CASE expression.............................................................................................. 113 Dynamic parameters......................................................................................... 115 JOIN operations..................................................................................................... 118 INNER JOIN operation......................................................................................118 LEFT OUTER JOIN operation...........................................................................119 RIGHT OUTER JOIN operation........................................................................ 120 CROSS JOIN operation.................................................................................... 121 NATURAL JOIN operation................................................................................ 122 SQL queries............................................................................................................123 query.................................................................................................................. 123 scalarSubquery.................................................................................................. 125 tableSubquery....................................................................................................125 Built-in functions....................................................................................................126 Standard built-in