blob: 7dc74ad1a1635838034cdb3934d93eba5d8c3c28 [file] [log] [blame]
////
/**
* @@@ START COPYRIGHT @@@
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
* @@@ END COPYRIGHT @@@
*/
////
[[About_This_Document]]
= About This Document
This manual describes reference information about the syntax of SQL statements, functions, and other
SQL language elements supported by the {project-name} projects database software.
{project-name} SQL statements and utilities are entered interactively or from script files using a client-based tool,
such as the Trafodion Command Interface (TrafCI). To install and configure a client application that enables you
to connect to and use a {project-name} database, see the
{docs-url}/client_install/index.html[_{project-name} Client Installation Guide_].
NOTE: In this manual, SQL language elements, statements, and clauses within statements are based on the
ANSI SQL:1999 standard.
[[Intended_Audience]]
== Intended Audience
This manual is intended for database administrators and application programmers who are using SQL to read, update,
and create {project-name} SQL tables, which map to HBase tables, and to access native HBase and Hive tables.
You should be familiar with structured query language (SQL) and with the American National Standard Database Language SQL:1999.
<<<
[[New_and_Changed_Information]]
== New and Changed Information
This edition includes updates for these new features:
[cols="50%,50%",options="header"]
|===
| New Feature | Location in the Manual
| Incremental UPDATE STATISTICS | <<update_statistics_statement,UPDATE STATISTICS Statement>>
|===
<<<
[[Document_Organization]]
== Document Organization
[cols="50%,50%",options="header"]
|===
|Chapter or Appendix | Description
| <<Introduction,Introduction>> | Introduces {project-name} SQL and covers topics such as data consistency,
transaction management, and ANSI compliance.
| <<SQL_Statements,SQL Statements>> | Describes the SQL statements supported by {project-name} SQL.
| <<SQL_Utilities,SQL Utilities>> | Describes the SQL utilities supported by {project-name} SQL.
| <<SQL_Language Elements,SQL Language Elements>> | Describes parts of the language, such as database objects, data types,
expressions, identifiers, literals, and predicates, which occur within the syntax of {project-name} SQL statements.
| <<SQL_Clauses,SQL Clauses>> | Describes clauses used by {project-name} SQL statements.
| <<SQL_Functions_and_Expressions,SQL Functions and Expressions>> | Describes specific functions and expressions that you can use in
{project-name} SQL statements.
| <<SQL_Runtime_Statistics,SQL Runtime Statistics>> | Describes how to gather statistics for active queries or for the Runtime
Management System (RMS) and describes the RMS counters that are returned.
| <<OLAP_Functions,OLAP Functions>> | Describes specific on line analytical processing functions.
| <<Reserved_Words,Appendix A: Reserved Words>> | Lists the words that are reserved in {project-name} SQL.
| <<Limits,Appendix B: Limits>> | Describes limits in {project-name} SQL.
|===
<<<
== Notation Conventions
This list summarizes the notation conventions for syntax presentation in this manual.
* UPPERCASE LETTERS
+
Uppercase letters indicate keywords and reserved words. Type these items exactly as shown. Items not enclosed in brackets are required.
+
```
SELECT
```
* lowercase letters
+
Lowercase letters, regardless of font, indicate variable items that you supply. Items not enclosed in brackets are required.
+
```
file-name
```
* &#91; &#93; Brackets
+
Brackets enclose optional syntax items.
+
```
DATETIME [start-field TO] end-field
```
+
A group of items enclosed in brackets is a list from which you can choose one item or none.
+
The items in the list can be arranged either vertically, with aligned brackets on each side of the list, or horizontally, enclosed in a pair of brackets and separated by vertical lines.
+
For example:
+
```
DROP SCHEMA schema [CASCADE]
DROP SCHEMA schema [ CASCADE | RESTRICT ]
```
<<<
* { } Braces
+
Braces enclose required syntax items.
+
```
FROM { grantee [, grantee ] ... }
```
+
A group of items enclosed in braces is a list from which you are required to choose one item.
+
The items in the list can be arranged either vertically, with aligned braces on each side of the list, or horizontally, enclosed in a pair of braces and separated by vertical lines.
+
For example:
+
```
INTERVAL { start-field TO end-field }
{ single-field }
INTERVAL { start-field TO end-field | single-field }
```
* | Vertical Line
+
A vertical line separates alternatives in a horizontal list that is enclosed in brackets or braces.
+
```
{expression | NULL}
```
* &#8230; Ellipsis
+
An ellipsis immediately following a pair of brackets or braces indicates that you can repeat the enclosed sequence of syntax items any number of times.
+
```
ATTRIBUTE[S] attribute [, attribute] ...
{, sql-expression } ...
```
+
An ellipsis immediately following a single syntax item indicates that you can repeat that syntax item any number of times.
+
For example:
+
```
expression-n ...
```
<<<
* Punctuation
+
Parentheses, commas, semicolons, and other symbols not previously described must be typed as shown.
+
```
DAY (datetime-expression)
@script-file
```
+
Quotation marks around a symbol such as a bracket or brace indicate the symbol is a required character that you must type as shown.
+
For example:
+
```
"{" module-name [, module-name] ... "}"
```
* Item Spacing
+
Spaces shown between items are required unless one of the items is a punctuation symbol such as a parenthesis or a comma.
+
```
DAY (datetime-expression) DAY(datetime-expression)
```
+
If there is no space between two items, spaces are not permitted. In this example, no spaces are permitted between the period and any other items:
+
```
myfile.sh
```
* Line Spacing
+
If the syntax of a command is too long to fit on a single line, each continuation line is indented three spaces and is separated from the preceding line by a blank line.
+
This spacing distinguishes items in a continuation line from items in a vertical list of selections.
+
```
match-value [NOT] LIKE _pattern
[ESCAPE esc-char-expression]
```
<<<
== Comments Encouraged
We encourage your comments concerning this document. We are committed to providing documentation that meets your
needs. Send any errors found, suggestions for improvement, or compliments to {project-support}.
Include the document title and any comment, error found, or suggestion for improvement you have concerning this document.