Oracle9i SQL Reference
Release 1 (9.0.1)

Part Number A90125-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

How to Read Syntax Diagrams, 2 of 3


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 inside rectangles. Type them exactly as shown in the rectangles. Parameters appear in lowercase inside ovals. Variables are used for the parameters. Punctuation, operators, delimiters, and terminators appear inside circles.

If the syntax diagram has more than one path, you can choose any path to travel. For example, in the following syntax you can specify either NOPARALLEL or PARALLEL:

parallel_clause::=


Text description of ap_syntx6.gif follows
Text description of parallel_clause

If you have the choice of more than one keyword, operator, or parameter, your options appear in a vertical list. For example, in the following syntax, you can specify one or more of the four parameters in the stack:

physical_attributes_clause::=


Text description of ap_syntx7.gif follows
Text description of physical_attributes_clause

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:

Parameter  Description  Examples 

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"

emp  

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 quotes. See the syntax description of 'text' in "Text Literals"

'Employee records' 

char 

The substitution value must be an expression of datatype CHAR or VARCHAR2 or a character literal in single quotes.  

ename

'Smith'  

condition 

The substitution value must be a condition that evaluates to TRUE or FALSE. See the syntax description of condition in Chapter 5, "Conditions"

ename >'A'  

date

d 

The substitution value must be a date constant or an expression of DATE datatype. 

TO_DATE(

'01-Jan-1994',

'DD-MON-YYYY') 

expr 

The substitution value can be an expression of any datatype as defined in the syntax description of expr in "About SQL Expressions"

sal + 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 datatype or a number constant as defined in the syntax description of number in "Number Literals"

AVG(sal)

15 * 7  

raw 

The substitution value must be an expression of datatype RAW

HEXTORAW('7D')  

subquery  

The substitution value must be a SELECT statement that will be used in another SQL statement. See SELECT

SELECT ename

FROM emp 

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


Text description of ap_syntxa.gif follows
Text description of drop_library

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 parameters, but not necessarily the one that appears on the main path. In the following example, you must choose one of the four settings:

compression_clauses::=


Text description of ap_syntx5.gif follows
Text description of compression_clauses

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


Text description of ap_syntx2a.gif follows
Text description of deallocate_unused_clause

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 expression, you can go back repeatedly to choose another, separated by commas.

expr_list::=


Text description of ap_syntx3a.gif follows
Text description of expr_list

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


Text description of ap_syntx4.gif follows
Text description of alter_java

According to the diagram, the following statement is valid:

ALTER JAVA SOURCE 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".


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback