Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Semestr2 / 1 - Oracle / Oracle selected docs / SQL reference.pdf
Скачиваний:
24
Добавлен:
12.05.2015
Размер:
11.92 Mб
Скачать

Parameter

Description

Examples

 

 

 

integer

The substitution value must be an integer as

72

 

defined by the syntax description of integer in

 

 

"Integer Literals" on page 2-55.

 

 

 

 

number

The substitution value must be an expression of

AVG(salary)

m

NUMBER datatype or a number constant as

15 * 7

defined in the syntax description of number in

 

 

n

"Number Literals" on page 2-56.

 

 

 

 

raw

The substitution value must be an expression of

HEXTORAW(’7D’)

 

datatype RAW.

 

 

 

 

subquery

The substitution value must be a SELECT

SELECT last_name

 

statement that will be used in another SQL

FROM employees

 

statement. See SELECT on page 18-4.

 

 

 

 

 

db_name

The substitution value must be the name of a

sales_db

 

nondefault database in an embedded SQL

 

 

program.

 

 

 

 

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, that is, on the horizontal line you are currently traveling. In the following example, library_name is a required parameter:

drop_library::=

DROP LIBRARY library_name ;

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, one of them is required. That is, you must choose one of the keywords or

How to Read Syntax Diagrams A-3

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::=

integer

COMPRESS

NOCOMPRESS

Optional Keywords and Parameters

If keywords and parameters appear in a vertical list above the main path, they are optional. In the following example, instead of traveling down a vertical line, you can continue along the main path:

deallocate_unused_clause::=

K

M

KEEP integer

DEALLOCATE UNUSED

According to the diagram, all of the following statements are valid:

DEALLOCATE UNUSED;

DEALLOCATE UNUSED KEEP 1000;

DEALLOCATE UNUSED KEEP 10M;

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::=

 

 

,

PARTITION

BY

value_expr

A-4 Oracle9i SQL Reference

Multipart Diagrams

Read a multipart diagram as if all the main paths were joined end to end. The following example is a two-part diagram:

alter_java::=

 

SOURCE

schema

.

ALTER

JAVA

 

object_name

 

CLASS

 

 

,schema_name

RESOLVER

(

(

match_string

)

)

COMPILE

 

 

 

 

 

 

 

 

RESOLVE

 

 

 

 

 

 

 

;

 

 

 

 

 

 

 

 

 

 

 

 

 

invoker_rights_clause

 

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 ("), it can contain any combination of legal characters, including spaces but excluding quotation marks.

Oracle identifiers are not case sensitive except when enclosed by double quotation marks.

For more information, see "Schema Object Naming Rules" on page 2-110.

How to Read Syntax Diagrams A-5

A-6 Oracle9i SQL Reference

B

Oracle and Standard SQL

This appendix discusses Oracle’s conformance with the SQL:1999 standards. The mandatory portion of SQL:1999 is known as Core SQL:1999 and is found in SQL:1999 Part 2 (Foundation) and Part 5 (Bindings). The Foundation features are analyzed in Annex F of Part 2 in the table "SQL/Foundation feature taxonomy and definition for Core SQL". The Bindings features are analyzed in Annex F of Part 5 in the table "SQL/Bindings feature taxonomy and definition for Core SQL".

This appendix declares Oracle’s conformance to the SQL standards established by the American National Standards Institute (ANSI) and the International Standards Organization (ISO). (The ANSI and ISO SQL standards are identical.) It contains the following sections:

ANSI Standards

ISO Standards

Oracle Compliance

FIPS Compliance

Oracle and Standard SQL B-1

Соседние файлы в папке Oracle selected docs