1. Trang chủ
  2. » Công Nghệ Thông Tin

a0110 oracle press oracle 9i the complete referenc morebook vn 0247

7 2 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Oracle9i: The Complete Reference
Tác giả Kevin Loney, George Koch, And the Experts at TUSC
Thể loại Reference book
Năm xuất bản 2002
Thành phố Berkeley, California
Định dạng
Số trang 7
Dung lượng 571,68 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

■ A comparison between an expression and ANY or ALL members of a list or between an expression and the values brought back from a query.. ■ A test to see if an expression is IN or NOT IN

Trang 1

The Complete Reference

Kevin Loney George Koch And the Experts at TUSC

McGraw-Hill/Osborne

New York Chicago San Francisco Lisbon London Madrid Mexico City Milan New Delhi San Juan Seoul Singapore Sydney Toronto

Trang 2

ORACLE Series TIGHT / Oracle9i: The Complete Reference / Loney, Koch / 222521-1 / Front Matter

Blind Folio FM:ii

McGraw-Hill/Osborne

2600 Tenth Street

Berkeley, California 94710

U.S.A

To arrange bulk purchase discounts for sales promotions, premiums, or fund-raisers, please contact

McGraw-Hill/Osborne at the above address For information on translations or book distributors

outside the U.S.A., please see the International Contact Information page immediately following the

index of this book

Oracle 9i: The Complete Reference

Copyright © 2002 by The McGraw-Hill Companies, Inc (Publisher) All rights reserved Printed in

the United States of America Except as permitted under the Copyright Act of 1976, no part of this

publication may be reproduced or distributed in any form or by any means, or stored in a database

or retrieval system, without the prior written permission of Publisher

Oracle is a registered trademark and Oracle9i is a trademark or registered trademark of Oracle

Corporation

1234567890 DOC DOC 0198765432

Book p/n 0-07-222707-9 and CD p/n 0-07-222708-7

parts of

ISBN 0-07-222521-1

Publisher

Brandon A Nordin

Vice President & Associate Publisher

Scott Rogers

Acquisitions Editor

Lisa McClain

Project Editor

LeeAnn Pickrell

Acquisitions Coordinator

Athena Honore

Technical Editor

Bob Bryla

Copy Editor

Margaret Berson

Proofreader

Cheryl Abel

Indexer

James Minkin

Computer Designers

Tabitha M Cagan, Lucie Ericksen

Illustrators

Michael Mueller, Lyssa Wald

Cover Series Design

Damore Johann Design, Inc.

This book was composed with Corel VENTURA™ Publisher

Information has been obtained by Publisher from sources believed to be reliable However, because of the possibility of human or

mechanical error by our sources, Publisher, or others, Publisher does not guarantee to the accuracy, adequacy, or completeness of

any information included in this work and is not responsible for any errors or omissions or the results obtained from the use of such

information.

Oracle Corporation does not make any representations or warranties as to the accuracy, adequacy or completeness of any information

contained in this Work, and is not responsible for any errors or omissions.

Composite Default screen

Trang 3

To my parents, and to Sue, Emily, Rachel, and Jane

—K.L.

To Elwood Brant, Jr (Woody), 1949–1990

—G.K.

Trang 4

ORACLE Series TIGHT / Oracle9i: The Complete Reference / Loney, Koch / 222521-1 / Front Matter

Blind Folio FM:iv

About the Authors Kevin Loney is a senior management technical consultant with

TUSC (http://www.tusc.com), an Oracle-focused consultancy headquartered in Chicago He is an expert in the administration, tuning, security, recovery, design, and development of Oracle databases and applications An Oracle DBA and developer since

1987, he is the primary author of numerous books, including Oracle9i DBA Handbook, Oracle9i Instant Scripts, and Oracle8 Advanced Tuning and Administration, all published by Oracle Press He is a frequent presenter at local and international Oracle user groups

George Koch is a leading authority on relational database

applications A popular speaker and widely published author, he is also the creator of THESIS, the securities trading, accounting, and portfolio management system that was the first major commercial applications product in the world to employ a relational database (Oracle) and provide English language querying to its users He is a former senior vice president of Oracle Corporation

Composite Default screen

Trang 5

Contents At a Glance

PART I

Critical Database Concepts

1 Sharing Knowledge and Success 3

2 The Dangers in a Relational Database 15

3 The Basic Parts of Speech in SQL 41

4 The Basics of Object-Relational Databases 69

5 Introduction to Web-Enabled Databases 83

PART II SQL and SQL*PLUS 6 Basic SQL*PLUS Reports and Commands 91

7 Getting Text Information and Changing It 113

8 Playing the Numbers 141

9 Dates: Then, Now, and the Difference 165

10 Conversion and Transformation Functions 193

11 Grouping Things Together 205

12 When One Query Depends upon Another 219

13 Some Complex Possibilities 237

14 Building a Report in SQL*PLUS 255

15 Changing Data: insert, update, merge, and delete 279

16 Advanced Use of Functions and Variables 297

17 DECODE and CASE: if, then, and else in SQL 311

18 Creating, Dropping, and Altering Tables and Views 325

19 By What Authority? 355

20 Changing the Oracle Surroundings 379

Trang 6

SELECT

UPDATE [user.]table [alias]

statement will return, a delete statement will delete, or an update statement will update.

A condition may be defined in one of several ways:

■ A comparison between expressions (=, >, !=, and so on).

■ A comparison between an expression and a query.

■ A comparison between a list of expressions and a list of expressions from a query.

A comparison between an expression and ANY or ALL members of a list or between

an expression and the values brought back from a query

A test to see if an expression is IN or NOT IN a list, or the results of a query.

A test for being BETWEEN or NOT BETWEEN one value and another.

A test to see if an expression IS NULL or IS NOT NULL.

A test to see if there EXISTS (or NOT EXISTS) any results for a query.

A combination of any of the above, using the conjunctions AND and OR.

EXAMPLES

where Section >ANY ('A','C','D');

where City !=ALL (select City from LOCATION);

where Section IN ('A','C','D');

where City NOT IN (select City from LOCATION);

where Page BETWEEN 4 and 7;

where Skill IS NULL;

where EXISTS (select * from WORKER where Age > 90);

where Section = 'A' or Section = 'B' and Page = 1;

WHILE (PL/SQL)

See LOOP, Chapter 27

WIDTH_BUCKET

FORMAT

is divided into intervals that have identical size (Compare this function with NTILE, which creates

equiheight histograms.) Ideally each bucket is a “closed-open” interval of the real number line For a

given expression, WIDTH_BUCKET returns the bucket number into which the value of this expression

would fall after being evaluated.expr is the expression (a number or datetime value) for which the

histogram is being created Ifexpr evaluates to NULL, the expression returns NULL min_value and

WIDTH_BUCKET 1199

ORACLE Series TIGHT / Oracle9i: The Complete Reference / Loney, Koch / 222521-1 / Chapter 1

Blind Folio 1:1199

Composite Default screen

Trang 7

max_value are expressions that resolve to the end points of the acceptable range for expr Both of

these expressions must also evaluate to number or datetime values, and neither can evaluate to NULL.

num_buckets is an expression that resolves to a constant indicating the number of buckets This expression

must evaluate to a positive integer

WRAP (SQL*PLUS)

See SET.

WRAPPING

Wrapping is moving the end of a heading or title, or the contents of a column, down to a new line when

it is too long to fit on one line (Contrast with TRUNCATE.) See COLUMN.

XML

XML (eXtensible Markup Language) is a standardized syntax for describing hierarchical data XML provides

a universal format for structured documents and data Its tag-based syntax gives it the flexibility to handle

complex data Whereas HTML tells a Web browser how to present data, XML tells applications what

the data means See Chapter 41 for examples

XMLType

XMLType is a datatype available as of Oracle9i to store and query XML data in the database As a

type, XMLType has member functions to access, extract, and query XML data using a class of operations

known as Xpath expressions The SYS_XMLGEN, SYS_XMLAGG, and DBMS_XMLGEN packages

create XMLType values from existing object-relational data When you designate a column as using

the XMLType datatype, Oracle will internally store the data in a CLOB datatype

The following listing shows the creation of a table using the XMLType:

datatype:

create table MY_XML_TABLE

(Key1 NUMBER,

Xml_Column SYS.XMLTYPE);

insert into MY_XML_TABLE (Key1, Xml_Column)

values (1, SYS.XMLTYPE.CREATEXML

('<book>

<title>Complete Reference</title>

<chapter num= "43">

<title>Ending</title>

<text>This is the end of the book.</text>

</chapter>

</book>'));

You can retrieve the data from the XMLType column via the GETCLOBVAL method:

select M.Xml_Column.GETCLOBVAL() as XML_Data

from MY_XML_TABLE M

where Key1 = 1;

See Chapter 41 for additional details on XMLType and its related methods

Ngày đăng: 03/12/2022, 22:08

TỪ KHÓA LIÊN QUAN

🧩 Sản phẩm bạn có thể quan tâm