oracle官方文档之SQL语句语法的图形表示法
来源:互联网 发布:js获取class 编辑:程序博客网 时间:2024/05/18 00:05
11g Release 2 (11.2)
E41084-02
Home
Book List
Contents
Index
Master Index
Contact Us
Previous
NextPDF ·Mobi · ePub
Graphic Syntax Diagrams
Syntax diagrams are drawings that illustrate valid SQL syntax. To read a diagram, trace it from left to right, in the direction shown by the arrows.
Commands and other keywords appear in UPPERCASE insiderectangles. Type them exactly as shown in the rectangles. Parameters(从句以及参数) appear in lowercase insideovals. Variables are used for the parameters. Punctuation, operators, delimiters, and terminators appear insidecircles.
If the syntax diagram has more than one path, then you can choose any path. For example, in the following syntax you can specify eitherNOPARALLEL
or PARALLEL
:
parallel_clause::=
Description of the illustration parallel_clause.gif
If you have the choice of more than one keyword, operator, or parameter, then your options appear in a vertical list. For example, in the following syntax diagram, you can specify one or more of the four parameters in the stack:
physical_attributes_clause::=
Description of the illustration physical_attributes_clause.gif
The following table shows parameters that appear in the syntax diagrams and provides examples of the values you might substitute for them in your statements:
Table A-1 Syntax Parameters
table
The substitution value must be the name of an object of the type specified by the parameter. For a list of all types of objects, see the section,"Schema Objects".
employees
c
The substitution value must be a single character from your database character set.
T
s
'text'
The substitution value must be a text string in single quotation marks. See the syntax description of 'text
' in"Text Literals".
'Employee records'
char
The substitution value must be an expression of data type CHAR
orVARCHAR2
or a character literal in single quotation marks.
last_name
'Smith'
condition
The substitution value must be a condition that evaluates to TRUE
orFALSE
. See the syntax description of condition
inChapter 7, "Conditions".
last_name >'A'
date
d
The substitution value must be a date constant or an expression of DATE
data type.
TO_DATE(
'01-Jan-2002',
'DD-MON-YYYY')
expr
The substitution value can be an expression of any data type as defined in the syntax description ofexpr in "About SQL Expressions".
salary + 1000
integer
The substitution value must be an integer as defined by the syntax description of integer in"Integer Literals".
72
number
m
n
The substitution value must be an expression of NUMBER
data type or a number constant as defined in the syntax description ofnumber in "Numeric Literals".
AVG(salary)
15 * 7
raw
The substitution value must be an expression of data type RAW
.
HEXTORAW('7D')
subquery
The substitution value must be a SELECT
statement that will be used in another SQL statement. SeeSELECT.
SELECT last_name
FROM employees
db_name
The substitution value must be the name of a nondefault database in an embedded SQL program.
sales_db
db_string
The substitution value must be the database identification string for an Oracle Net database connection. For details, see the user's guide for your specific Oracle Net protocol.
—
Required Keywords and Parameters
Required keywords and parameters can appear singly or in a vertical list of alternatives. Single required keywords and parameters appear on the main path, which is the horizontal line you are currently traveling. In the following example,library_name
is a required parameter:
drop_library::=
Description of the illustration drop_library.gif
If there is a library named HQ_LIB
, then, according to the diagram, the following statement is valid:
DROP LIBRARY hq_lib;
If multiple keywords or parameters appear in a vertical list that intersects the main path, then one of them is required. You must choose one of the keywords or parameters, but not necessarily the one that appears on the main path. In the following example, you must choose one of the two settings:
key_compression::=
Description of the illustration key_compression.gif
Optional Keywords and Parameters
If keywords and parameters appear in a vertical list above the main path, then they are optional. In the following example, instead of traveling down a vertical line, you can continue along the main path:
deallocate_unused_clause::=
Description of the illustration deallocate_unused_clause.gif
size_clause::=
Description of the illustration size_clause.gif
According to the diagrams, all of the following statements are valid:
DEALLOCATE UNUSED;DEALLOCATE UNUSED KEEP 1000;DEALLOCATE UNUSED KEEP 10G;DEALLOCATE UNUSED 8T; 注释:DEALLOCATE UNUSED KEEP 10G;该语句中10就是integer(即整数类型的数据),G就是图中那好几大写字母中的G。
同时,我们发现,在旁支上的有些关键字是可以省略的,如keep。例如, DEALLOCATE UNUSED 8T;
再例如,
在alter database语句中,
alter_datafile_clause::=
datafile filenumber offline for drop中的for可以省略。
Syntax Loops
Loops let you repeat the syntax within them as many times as you like. In the following example, after choosing one value expression, you can go back repeatedly to choose another, separated by commas.
query_partition_clause::=
Description of the illustration query_partition_clause.gif
Multipart Diagrams
Read a multipart diagram as if all the main paths were joined end to end. The following example is a three-part diagram:
alter_java::=
Description of the illustration alter_java.gif
According to the diagram, the following statement is valid:
ALTER JAVA SOURCE jsource_1 COMPILE;
Database Objects
The names of Oracle identifiers, such as tables and columns, must not exceed 30 characters in length. The first character must be a letter, but the rest can be any combination of letters, numerals, dollar signs ($), pound signs (#), and underscores (_).
However, if an Oracle identifier is enclosed by double quotation marks ("), then it can contain any combination of legal characters, including spaces but excluding quotation marks. Oracle identifiers are not case sensitive except within double quotation marks.
See Also:
"Database Object Naming Rules" for more information- oracle官方文档之SQL语句语法的图形表示法
- ORACLE sql语法的表示问题
- 比较常用的SQL语句语法(Oracle)
- 比较常用的SQL语句语法(Oracle)
- Oracle 基本SQL语句语法
- oracle常用sql语句语法
- oracle常用sql语句语法
- Oracle数据库Sql语句详解之SELECT查询基本语法
- oracle官方文档之Memory Architecture之Shared SQL Areas and Private SQL Areas
- 比较常用的Oracle的SQL语句语法
- 比较常用的Oracle的SQL语句语法
- 转帖:ORacle的官方文档
- oracle数据库常用的sql语法语句总结
- Oracle PL/SQL 中循环语法语句的应用
- SQL语法之查询语句
- SQL语句之语法汇总
- linux官方文档翻译--Kconfig的语法
- linux官方文档翻译 -- Makefile的语法
- VS2010 更改MFC标题栏图标和生成的执行文件图标
- LINUX时间同步
- 如果你喜欢上了一个程序员小伙 献给所有的程序员女友
- 获取iphone的硬件版本以及系统信息
- Android EditText 禁止换行
- oracle官方文档之SQL语句语法的图形表示法
- Android 保存图片到系统及相关问题的解决方案
- 免费打电话。
- UIImage常用的分类
- rabbitmq连接被阻塞,无法接收消息
- 算法之旅,直奔pair
- Google Chrome Source Code 浏览器源码(下载)
- d3学习之(Data Visualization with d3.js Cookbook )二(第二章)
- 弹出dialog 窗口; 以及在dialog 中关闭并且刷新父窗体的方法