0% found this document useful (0 votes)
2 views

Oracle® Database

The Oracle Database SQL Language Reference, 21c, provides comprehensive documentation on SQL standards, data types, and the functionality of Oracle SQL. It includes guidelines for using the software, licensing information, and disclaimers regarding third-party content. The document is intended for users seeking to understand and utilize Oracle SQL effectively in various applications.

Uploaded by

Venkat Kv
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Oracle® Database

The Oracle Database SQL Language Reference, 21c, provides comprehensive documentation on SQL standards, data types, and the functionality of Oracle SQL. It includes guidelines for using the software, licensing information, and disclaimers regarding third-party content. The document is intended for users seeking to understand and utilize Oracle SQL effectively in various applications.

Uploaded by

Venkat Kv
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Oracle® Database

SQL Language Reference


21c
F31301-17
November 2024
Oracle Database SQL Language Reference, 21c
F31301-17
Copyright © 1996, 2024, Oracle and/or its affiliates.
Primary Author: Usha Krishnamurthy
Contributors: Mary Beth Roeser, Drew Adams, Lance Ashdown, Thomas Baby,
Hermann Baer, Yasin Baskan, Nigel
Bayliss, Shuo Chen, Eric Belden, Atif Chaudhry, Dinesh Das, Mark Dilman, Yanfei
Fan, Zhenqiang Fan , Mahesh
Girkar, Naveen Gopal, Beda Hammerschmidt, Patricia Huey, Peter Knaggs,
Sriram Krishnamurthy, Praveen Kumar,
Hariharan Lakshmanan, Bill Lee, Huagang Li , Yunrui Li, Roger MacNicol, David
Mcdermid, Dan Melinger, Jan Michels,
Cesar Miramontes, Rahil Mir, Gopal Mulagund, Abhishek Munnolimath , Ian Neall,
Padmaja Potineni, Giridhar Ravipati,
Alfonso Colunga Sosa , Josh Spiegel, James Stamos, Srikrishnan Suresh , Nirav
Vyas, Alan Williams, Andy Witkowski,
Sergiusz Wolicki, Weiran Zhang
This software and related documentation are provided under a license
agreement containing restrictions on use and
disclosure and are protected by intellectual property laws. Except as expressly
permitted in your license agreement or
allowed by law, you may not use, copy, reproduce, translate, broadcast, modify,
license, transmit, distribute, exhibit,
perform, publish, or display any part, in any form, or by any means. Reverse
engineering, disassembly, or decompilation
of this software, unless required by law for interoperability, is prohibited.
The information contained herein is subject to change without notice and is not
warranted to be error-free. If you find
any errors, please report them to us in writing.
If this is software, software documentation, data (as defined in the Federal
Acquisition Regulation), or related
documentation that is delivered to the U.S. Government or anyone licensing it on
behalf of the U.S. Government, then
the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs (including any operating
system, integrated software, any
programs embedded, installed, or activated on delivered hardware, and
modifications of such programs) and Oracle
computer documentation or other Oracle data delivered to or accessed by U.S.
Government end users are "commercial
computer software," "commercial computer software documentation," or "limited
rights data" pursuant to the applicable
Federal Acquisition Regulation and agency-specific supplemental regulations. As
such, the use, reproduction,
duplication, release, display, disclosure, modification, preparation of derivative
works, and/or adaptation of i) Oracle
programs (including any operating system, integrated software, any programs
embedded, installed, or activated on
delivered hardware, and modifications of such programs), ii) Oracle computer
documentation and/or iii) other Oracle
data, is subject to the rights and limitations specified in the license contained in
the applicable contract. The terms
governing the U.S. Government's use of Oracle cloud services are defined by the
applicable contract for such services.
No other rights are granted to the U.S. Government.
This software or hardware is developed for general use in a variety of
information management applications. It is not
developed or intended for use in any inherently dangerous applications,
including applications that may create a risk of
personal injury. If you use this software or hardware in dangerous applications,
then you shall be responsible to take all
appropriate fail-safe, backup, redundancy, and other measures to ensure its safe
use. Oracle Corporation and its
affiliates disclaim any liability for any damages caused by use of this software or
hardware in dangerous applications.
Oracle®, Java, MySQL, and NetSuite are registered trademarks of Oracle and/or
its affiliates. Other names may be
trademarks of their respective owners.
Intel and Intel Inside are trademarks or registered trademarks of Intel
Corporation. All SPARC trademarks are used
under license and are trademarks or registered trademarks of SPARC
International, Inc. AMD, Epyc, and the AMD logo
are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a
registered trademark of The Open
Group.
This software or hardware and documentation may provide access to or
information about content, products, and
services from third parties. Oracle Corporation and its affiliates are not
responsible for and expressly disclaim all
warranties of any kind with respect to third-party content, products, and services
unless otherwise set forth in an
applicable agreement between you and Oracle. Oracle Corporation and its
affiliates will not be responsible for any loss,
costs, or damages incurred due to your access to or use of third-party content,
products, or services, except as set forth
in an applicable agreement between you and Oracle.
Contents
Preface
Audience xxvi
Documentation Accessibility xxvi
Related Documents xxvi
Conventions xxvii
Changes in This Release for Oracle Database SQL Language Reference
Changes in Oracle Database Release 21c xxviii
1 Introduction to Oracle SQL
History of SQL 1-1
SQL Standards 1-1
How SQL Works 1-1
Common Language for All Relational Databases 1-2
Using Enterprise Manager 1-2
Lexical Conventions 1-2

2
Tools Support 1-3
2 Basic Elements of Oracle SQL
Data Types 2-1
Oracle Built-in Data Types 2-5
Character Data Types 2-8
Numeric Data Types 2-12
LONG Data Type 2-16
Datetime and Interval Data Types 2-18
RAW and LONG RAW Data Types 2-26
Large Object (LOB) Data Types 2-27
JSON Data Type 2-30
Extended Data Types 2-30
Rowid Data Types 2-32
ROWID Data Type 2-32
iii
UROWID Data Type 2-32
ANSI, DB2, and SQL/DS Data Types 2-33
User-Defined Types 2-34
Object Types 2-35
REF Data Types 2-35
Varrays 2-35
Nested Tables 2-35
Oracle-Supplied Types 2-36
Any Types 2-36
ANYTYPE 2-36
ANYDATA 2-36
ANYDATASET 2-37
XML Types 2-37
XMLType 2-37
URI Data Types 2-38
URIFactory Package 2-39
Spatial Types 2-39
SDO_GEOMETRY 2-39
SDO_TOPO_GEOMETRY 2-39
SDO_GEORASTER 2-40
Data Type Comparison Rules 2-40
Numeric Values 2-40
Datetime Values 2-40
Binary Values 2-41
Character Values 2-41
Object Values 2-44
Varrays and Nested Tables 2-44
Data Type Precedence 2-44
Data Conversion 2-45
Implicit and Explicit Data Conversion 2-45
Implicit Data Conversion 2-45
Implicit Data Conversion Examples 2-48
Explicit Data Conversion 2-48
Security Considerations for Data Conversion 2-50
Literals 2-51
Text Literals 2-51
Numeric Literals 2-53
Integer Literals 2-53

3
NUMBER and Floating-Point Literals 2-54
Datetime Literals 2-56
Interval Literals 2-59
INTERVAL YEAR TO MONTH 2-60

You might also like