OracleRdb SQLReferenceManual Volume1 - Oracle Software Downloads

嚜燈racle Rdb?

SQL Reference Manual

Volume 1

Oracle Rdb Release 7.1.4.3 for OpenVMS Alpha

December 2005

?

DEC_Callout (encoded characters)

FullName: DEC Modular Callouts

Notice: Copyright 1988 - 1993, Digital Equipment Corporation.

0

40 1.000

cx0

6

60 0.500

bx6

2

100 0.500

ex2

120 0.000

1

41 1.000

cx1

7

61 0.500

bx7

3

101 0.500

ex3

121 0.000

2

42 1.000

cx2

8

62 0.500

bx8

4

102 0.500

ex4

122 0.000

3

43 1.000

cx3

9

63 0.500

bx9

5

103 0.500

ex5

123 0.000

4

44 1.000

cx4

0

64 0.375

mx0

6

104 0.500

ex6

124 0.000

5

45 1.000

cx5

1

65 0.375

mx1

7

105 0.500

ex7

125 0.000

6

46 1.000

cx6

2

66 0.375

mx2

8

106 0.500

ex8

126 0.000

7

47 1.000

cx7

3

67 0.375

mx3

Distiller, PostScript v3011.104 r0

Font version: 1.3, 13-Oct-1993

8

50 1.000

cx8

4

70 0.375

mx4

9

51 1.000

cx9

5

71 0.375

mx5

0

52 0.500

bx0

6

72 0.375

mx6

1

53 0.500

bx1

7

73 0.375

mx7

2

54 0.500

bx2

8

74 0.375

mx8

3

55 0.500

bx3

9

75 0.375

mx9

4

56 0.500

bx4

0

76 0.500

ex0

5

57 0.500

bx5

1

77 0.500

ex1

9

107 0.500

ex9

127 0.000

110 0.000

130 0.000

111 0.000

131 0.000

112 0.000

132 0.000

113 0.000

133 0.000

114 0.000

134 0.000

115 0.000

135 0.000

116 0.000

136 0.000

117 0.000

137 0.000

140 0.000

141 0.000

142 0.000

143 0.000

144 0.000

145 0.000

146 0.000

147 0.000

150 0.000

151 0.000

152 0.000

153 0.000

154 0.000

155 0.000

156 0.000

157 0.000

160 0.000

161 0.000

162 0.000

163 0.000

164 0.000

165 0.000

166 0.000

167 0.000

170 0.000

171 0.000

172 0.000

173 0.000

174 0.000

175 0.000

176 0.000

177 0.000

0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 01234567890 1 2 3 4 5 6 7 8 9

240 0.000

260 0.000

300 0.000

320 0.000

241 0.000

261 0.000

301 0.000

321 0.000

242 0.000

262 0.000

302 0.000

322 0.000

243 0.000

263 0.000

303 0.000

323 0.000

244 0.000

264 0.000

304 0.000

324 0.000

245 0.000

265 0.000

305 0.000

325 0.000

246 0.000

266 0.000

306 0.000

326 0.000

247 0.000

267 0.000

307 0.000

327 0.000

250 0.000

270 0.000

310 0.000

330 0.000

251 0.000

271 0.000

311 0.000

331 0.000

252 0.000

272 0.000

312 0.000

332 0.000

253 0.000

273 0.000

313 0.000

333 0.000

254 0.000

274 0.000

314 0.000

334 0.000

255 0.000

275 0.000

315 0.000

335 0.000

256 0.000

276 0.000

316 0.000

336 0.000

257 0.000

277 0.000

317 0.000

337 0.000

340 0.000

341 0.000

342 0.000

343 0.000

344 0.000

345 0.000

346 0.000

347 0.000

350 0.000

351 0.000

352 0.000

353 0.000

354 0.000

355 0.000

356 0.000

357 0.000

360 0.000

361 0.000

362 0.000

363 0.000

364 0.000

365 0.000

366 0.000

367 0.000

370 0.000

371 0.000

372 0.000

373 0.000

374 0.000

375 0.000

376 0.000

377 0.000

SQL Reference Manual, Volume 1

Oracle Rdb Release 7.1.4.3 for OpenVMS Alpha

Copyright ? 1987, 2005 Oracle Corporation. All rights reserved.

The Programs (which include both the software and documentation) contain proprietary

information of Oracle Corporation; they are provided under a license agreement containing

restrictions on use and disclosure and are also protected by copyright, patent and

other intellectual and industrial property laws. Reverse engineering, disassembly, or

decompilation of the Programs is prohibited.

The information contained in this document is subject to change without notice. If you find

any problems in the documentation, please report them to us in writing. Oracle Corporation

does not warrant that this document is error-free. Except as may be expressly permitted in

your license agreement for these Programs, no part of these Programs may be reproduced

or transmitted in any form or by any means, electronic or mechanical, for any purpose,

without the express written permission of Oracle Corporation.

If the Programs are delivered to the U.S. Government or anyone licensing or using the

programs on behalf of the U.S. Government, the following notice is applicable:

U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation

and technical data delivered to U.S. Government customers are "commercial computer

software" or "commercial technical data" pursuant to the applicable Federal Acquisition

Regulation and agency-specific supplemental regulations. As such, use, duplication,

disclosure, modification, and adaptation of the Programs, including documentation and

technical data, shall be subject to the licensing restrictions set forth in the applicable

Oracle license agreement, and, to the extent applicable, the additional rights set forth in

FAR 52.227-19, Commercial Computer Software - Restricted Rights (June, 1987). Oracle

Corporation, 500 Oracle Parkway, Redwood City, CA 94065.

The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or

other inherently dangerous applications. It shall be the licensee*s responsibility to take

all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use

of such applications if the Programs are used for such purposes, and Oracle Corporation

disclaims liability for any damages caused by such use of the Programs.

Oracle is a registered trademark, and Hot Standby, LogMiner for Rdb, Oracle

CDD/Repository, Oracle CODASYL DBMS, Oracle Expert, Oracle Rdb, Oracle RMU,

Oracle RMUwin, Oracle SQL/Services, Oracle Trace, and Rdb7 are trademark or registered

trademarks of Oracle Corporation. Other names may be trademarks of their respective

owners.

The Programs may provide links to Web sites and access to content, products, and services

from third parties. Oracle is not resonsible for the availability of, or any content provided

on, third-party Web sites. You bear all risks associated with the use of such content. If you

choose to purchase any products or services from a third party, the relationship is directly

between you and the third party. Oracle is not responsible for: (a) the quality of third-party

products or services; or (b) fulfilling any of the terms of the agreement with the third party,

including delivery of products or services and warranty obligations related to purchased

products or services. Oracle is not responsible for any loss or damage of any sort that you

may incur from dealing with any third party.

Contents

Send Us Your Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xi

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xiii

Technical Changes and New Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xvii

1 Introduction to SQL Syntax

1.1

1.1.1

1.2

1.3

1.4

1.5

1.6

1.6.1

1.7

Using SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Invoking SQL Images . . . . . . . . . . . . . . . . . . . . .

Samples Directory . . . . . . . . . . . . . . . . . . . . . . . . . . .

How to Read Syntax Diagrams . . . . . . . . . . . . . . . . .

Executable and Nonexecutable Statements . . . . . . . .

Summary of SQL Statements . . . . . . . . . . . . . . . . . . .

Keywords and Line Terminators . . . . . . . . . . . . . . . .

Statement Terminators and Comment Characters

Support for Multivendor Integration Architecture . .

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

1每1

1每2

1每3

1每3

1每6

1每7

1每13

1每13

1每16

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

2每1

2每6

2每7

2每8

2每9

2每10

2每11

2每12

2每13

2每14

2每15

2每16

2 Language and Syntax Elements

2.1

Supported Character Sets . . . . . . . . .

2.1.1

Automatic Translation . . . . . . . . .

2.1.2

Character Set HEX . . . . . . . . . . .

2.1.3

Default Character Sets . . . . . . . . .

2.1.4

Display Character Set . . . . . . . . .

2.1.5

Identifier Character Set . . . . . . . .

2.1.6

Literal Character Sets . . . . . . . . .

2.1.7

National Character Set . . . . . . . .

2.1.8

Character Set ISOLATIN9 . . . . . .

2.1.9

Oracle NLS Character Set Names

2.1.10

Character Set UNSPECIFIED . . .

2.1.11

Logical Names for Character Sets

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

iii

2.2

User-Supplied Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.1

Aliases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.2

Authorization Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.2.1

Authorization Identifiers and Stored Modules . . . . . . . . . . . .

2.2.2.2

Authorization Identifiers and Nonstored Modules . . . . . . . . .

2.2.3

Catalog Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.4

Column Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.4.1

Correlation Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.4.2

Outer References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.5

Connection Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.6

Constraint Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.7

Cursor Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.8

Database Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.8.1

Oracle Rdb Attach Specifications . . . . . . . . . . . . . . . . . . . . . .

2.2.8.2

Repository Path Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.9

Domain Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.10

Index Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.11

Names in Multischema Databases . . . . . . . . . . . . . . . . . . . . . . . .

2.2.12

Nonstored Module, Procedure, and Parameter Names (Module

Language Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.13

Parameters, Routine Parameters, and SQL Variables . . . . . . . . .

2.2.13.1

Data Parameters and Indicator Parameters . . . . . . . . . . . . .

2.2.13.2

Host Structures and Indicator Arrays . . . . . . . . . . . . . . . . . .

2.2.13.3

Multistatement Procedure Variables and Stored Routine

Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.13.4

External Routine Parameters . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.14

Statement Names (Dynamic SQL Only) . . . . . . . . . . . . . . . . . . . .

2.2.15

Schema Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.16

Storage Area Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.17

Storage Map Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.18

Stored Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.19

Table and View Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2.20

Trigger Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.3

Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.3.1

Character Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.3.1.1

Calculating the Maximum Length of a CHAR or VARCHAR

Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.3.2

Date-Time Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.3.3

DECIMAL and NUMERIC Data Types . . . . . . . . . . . . . . . . . . . .

2.3.4

NUMBER Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.3.5

Fixed-Point Numeric Data Types . . . . . . . . . . . . . . . . . . . . . . . . .

2.3.6

Floating-Point Numeric Data Types . . . . . . . . . . . . . . . . . . . . . . .

iv

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

2每16

2每25

2每26

2每27

2每31

2每31

2每32

2每34

2每36

2每37

2每38

2每38

2每38

2每39

2每42

2每43

2每44

2每44

.

.

.

.

.

.

.

.

.

.

.

.

2每46

2每47

2每49

2每51

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

2每55

2每56

2每56

2每56

2每58

2每59

2每59

2每60

2每63

2每64

2每68

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

2每70

2每71

2每78

2每79

2每80

2每81

2.3.7

LIST OF BYTE VARYING Data Type . . . . . . . . . . . . . . . . . . . . . . .

2.3.7.1

On-Disk Format of Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.3.8

Data Type Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.3.8.1

Conversion from Unsupported Data Types . . . . . . . . . . . . . . . . .

2.3.8.2

Conversion Between Supported Data Types . . . . . . . . . . . . . . . .

2.4

Literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.4.1

Numeric Literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.4.2

Character String Literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.4.2.1

Quoted Character String Literals . . . . . . . . . . . . . . . . . . . . . . . .

2.4.2.1.1

Quoted Character String Literals Qualified by a Character

Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.4.2.1.2

Quoted Character String Literals Qualified by the National

Character Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.4.2.2

Hexadecimal Character String Literals . . . . . . . . . . . . . . . . . . .

2.4.3

Date-Time Literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.5

SQL and DATATRIEVE Formatting Clauses . . . . . . . . . . . . . . . . . . . . .

2.5.1

QUERY HEADER Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.5.2

EDIT STRING Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.6

Value Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.6.1

NULL Keyword Used as an Expression . . . . . . . . . . . . . . . . . . . . . .

2.6.2

Built-In Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.6.2.1

BITSTRING Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.6.2.2

CAST Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.6.2.3

CHARACTER_LENGTH Function . . . . . . . . . . . . . . . . . . . . . . .

2.6.2.4

CURRENT_DATE Function . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.6.2.5

CURRENT_TIME and LOCALTIME Functions . . . . . . . . . . . . .

2.6.2.6

CURRENT_TIMESTAMP and LOCALTIMESTAMP

Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.6.2.7

CURRENT_UID Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.6.2.8

CURRENT_USER Function . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.6.2.9

EXTRACT Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.6.2.10

LOWER Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.6.2.11

OCTET_LENGTH Function . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.6.2.12

POSITION Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.6.2.13

SESSION_UID Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.6.2.14

SESSION_USER Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.6.2.15

SIZEOF Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.6.2.16

SUBSTRING Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.6.2.17

SYSTEM_UID Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.6.2.18

SYSTEM_USER Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.6.2.19

TRANSLATE Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.6.2.20

TRANSLATE USING Function . . . . . . . . . . . . . . . . . . . . . . . . .

2.6.2.21

TRIM Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

.

.

.

.

.

.

.

.

.

2每81

2每83

2每86

2每87

2每88

2每93

2每93

2每94

2每95

.

2每97

.

.

.

.

.

.

.

.

.

.

.

.

.

.

2每97

2每98

2每98

2每104

2每106

2每106

2每123

2每130

2每131

2每133

2每134

2每137

2每138

2每139

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

2每140

2每143

2每143

2每144

2每148

2每149

2每150

2每152

2每152

2每152

2每154

2每155

2每155

2每155

2每158

2每161

v

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download