SQL Reference for SAP Vora in SAP Data Hub Company

SQL Reference for SAP Vora in SAP Data Hub Company

PUBLIC SAP Data Hub 2.5 Document Version: 2.5.0 – 2019-04-19 SQL Reference for SAP Vora in SAP Data Hub company. All rights reserved. All rights company. affiliate THE BEST RUN 2019 SAP SE or an SAP SE or an SAP SAP 2019 © Content 1 SQL Reference for SAP Vora in SAP Data Hub...................................... 4 1.1 Notation................................................................... 4 1.2 Introduction to SQL........................................................... 5 1.3 Data Types..................................................................7 Classification of Data Types................................................... 7 Boolean Data Type..........................................................7 Character String Data Types...................................................8 Date/Time Types..........................................................10 Numeric Types............................................................11 Constant Literals..........................................................14 Data Type Conversion.......................................................15 1.4 SQL Statements.............................................................16 Access Control (DDL).......................................................26 Data Manipulation Language (DML)............................................ 36 Data Definition Language (DDL)...............................................48 Data Query Language (DQL)..................................................83 1.5 SQL Functions and Operators ...................................................88 Numeric Functions........................................................ 98 String Functions..........................................................99 Datetime Functions.......................................................100 Data Type Conversion Functions..............................................102 Hierarchy Functions.......................................................105 Miscellaneous Functions....................................................106 Table-Valued Functions.....................................................108 Partitioning Tables........................................................109 1.6 System Views..............................................................112 SYS.TABLES.............................................................115 SYS.SCHEMAS...........................................................116 SYS.TABLE_COLUMNS.....................................................116 SYS.VIEWS..............................................................117 SYS.CONSTRAINTS........................................................117 SYS.MATERIALIZED_VIEWS..................................................118 SYS.MATERIALIZED_VIEW_COLUMNS..........................................118 SYS.SYNONYMS..........................................................119 SYS.DUMMY............................................................120 SYS.VORA_DATABASE.....................................................120 SQL Reference for SAP Vora in SAP Data Hub 2 PUBLIC Content SYS.M_DATABASE........................................................120 SYS.VORA_CAPABILITIES...................................................121 SYS.VORA_FUNCTIONS.................................................... 121 SYS.VORA_TABLES....................................................... 122 SYS.VORA_TABLE_COLUMNS................................................122 SYS.VORA_DATASOURCES..................................................123 SYS.VORA_PARTITION_SCHEMES.............................................124 SYS.VORA_PARTITION_FUNCTIONS...........................................124 SYS.VORA_PARTITION_PARAMETERS..........................................125 SYS.VORA_PARTITION_DEFINITIONS.......................................... 125 SYS.OBJECTS........................................................... 126 SYS.OBJECT_VERSIONS....................................................126 SYS.OBJECT_DEPENDENCIES................................................127 SYS.ROLES.............................................................128 SYS.USERS.............................................................128 SYS.GRANTED_ROLES.....................................................129 SYS.GRANTED_PRIVILEGES.................................................129 SYS.AUDIT_POLICIES......................................................130 SYS.VORA_STATISTICS.....................................................131 SYS.VORA_SERIES_TABLES................................................. 131 SYS.SERIES_KEY_COLUMNS................................................ 132 SYS.VORA_DATASOURCE_FILES..............................................132 1.7 SAP VORA Configuration Framework..............................................133 Alter System............................................................133 SQL Reference for SAP Vora in SAP Data Hub Content PUBLIC 3 1 SQL Reference for SAP Vora in SAP Data Hub The SAP Vora SQL Reference describes all SQL data types, predicates, operators, expressions, functions, statements, error codes, and system views. SAP Vora SQL is aligned with the SQL used by SAP HANA, so the SAP HANA SQL Reference is an additional valuable source of information. In general, SAP Vora SQL is a subset of SAP HANA SQL - the cases where Vora SQL differs from HANA SQL are pointed out explicitly. Also note that the public interface is aligned with the SQL 2011 standard. Related Information Notation [page 4] Introduction to SQL [page 5] Data Types [page 7] SQL Statements [page 16] SQL Functions and Operators [page 88] System Views [page 112] SAP VORA Configuration Framework [page 133] 1.1 Notation This reference uses EBNF (extended Backus-Naur form), a notation technique used to define programming languages. EBNF describes the syntax of a grammar using a set of production rules and a set of symbols. The following items are used in this guide: Symbol Meaning ::= Definition, left side is defined by right side | OR operator ( ... ) Grouped tokens { ... } Zero or more repetitions [ ... ] Zero or one repetition '...' Literal final token Note All uppercase strings are used as final literal tokens. All lowercase strings are non-terminal symbols. SQL Reference for SAP Vora in SAP Data Hub 4 PUBLIC SQL Reference for SAP Vora in SAP Data Hub 1.2 Introduction to SQL This section describes the SAP Vora database implementation of Structured Query Language (SQL). Supported Languages and Code Pages The SAP Vora database supports Unicode to allow the use of all languages in the Unicode Standard and 7 Bit ASCII code page without restriction. Comments You can add comments to improve the readability and maintainability of your SQL statements. Comments are delimited in SQL statements as follows: ● Double hyphens "--". Everything after the double hyphen until the end of a line is ignored by the SQL parser. ● "/*" and "*/". This style of commenting is used to place comments on multiple lines. All text between the opening "/*" and closing "*/" is ignored by the SQL parser. Example of using comments: -- creating a schema: CREATE SCHEMA s; /* let's set this schema to use it: */ SET SCHEMA s; Identifiers Identifiers are used to represent names used in SQL statement including table name, view name, synonym name, column name, index name, function name, procedure name, user name, role name, and so on. There are two kinds of identifiers, undelimited identifiers and delimited identifiers: ● Undelimited identifiers must start with a letter and cannot contain any symbols other than digits or an underscore "_". ● Delimited identifiers are enclosed in the delimiter, double quotes. The identifier can then contain any character including special characters. "AB$%CD" is a valid identifier name for example. ● Limitations: ○ Undelimited identifiers must not be equal to any reserved keywords. Using delimiters is a safe way to avoid conflicts with reserved keywords. ○ There is a set of identifiers which are used for the database engine and therefore cannot be used in specific contexts. See System Views [page 112]. SQL Reference for SAP Vora in SAP Data Hub SQL Reference for SAP Vora in SAP Data Hub PUBLIC 5 Example of using delimited and undelimited identifiers: CREATE TABLE t("1+1" INT) TYPE DATASOURCE; SELECT "1+1" FROM t; Identifiers and Case Sensitivity Identifiers without double-quotes in SQL syntax are converted to upper case when processed by the server. For example, the statement CREATE COLUMN TABLE MyTAB... creates a table called MYTAB, whereas CREATE COLUMN TABLE "MyTab" creates a table called MyTab - and both tables can co-exist in the database. Sample Code -- both these statements will succeed: CREATE TABLE MyTable(i INT) TYPE DATASOURCE; CREATE TABLE "MyTable"(i INT) TYPE DATASOURCE; Specifying identifiers without double-quotes is allowed but can cause ambiguity later when querying or performing operations on objects where casing in the identifier name is significant. A recommendation is to standardize to using double-quotes around all identifiers in SQL statements where ambiguity may be a concern. Quotation Marks Single quotation marks (') are used to delimit string literals. A single quotation mark itself can be represented using two single quotation marks (''). Double quotation marks are used to delimit identifiers. A double quotation mark itself can be represented using two double quotation marks The following example: CREATE TABLE t1(name CHAR(10), "a""strange_name" int) WITH TYPE STREAMING; INSERT INTO

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    138 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us