Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Programming PL SQL.doc
Скачиваний:
3
Добавлен:
01.07.2025
Размер:
5 Мб
Скачать
☆

7.2.8 Internet Datatypes

Oracle9i offers native support for several Internet-related technologies and types of data, specificallyXML (Extensible Markup Language) and URIs (Universal Resource Identifiers). Oracle provides datatypes used to handle XML and URI data, as well as a class of URIs called DBUri-REFs used to access data stored within the database itself. Oracle also provides a new set of types to store and access both external and internal URIs from within the database.

The XMLType allows you to query and store XML data in the database using functions like SYS_XMLGEN and the DBMS_XMLGEN package. It also allows you to use native operators in the SQL language to perform searching with the XPath language.

The URI-related types, including URIType and HttpURIType, are all part of an object type inheritance hierarchy and can be used to store URLs to external web pages and files, as well as to refer to data within the database.

Chapter 12 explores the rules for working with XMLType and URI types, provides many examples, and explains the built-in functions and packages provided to manipulate these datatypes.

7.2.9 "Any" Datatypes

Most of the time, our programming tasks are fairly straightforward and very specific to the requirement at hand. At other times, however, we write more generic kinds of code. For those situations, the "Any" datatypes might come in very handy.

The "Any" types are new to Oracle9i andare very different from any other kind of datatype available in Oracle. They let you dynamically encapsulate and access type descriptions, data instances, and sets of data instances of any other SQL type. I can use these types (and the methods defined for them, as they are object types) to do things like determine the type of data stored in a particular nested table—without having access to the actual declaration of that table type!

The "Any" datatypes include AnyType, AnyData, and AnyDataSet.

Chapter 12 explores the rules for working with the "Any" datatypes and provides some working examples of this new and exciting technology.

7.2.10 User-Defined Datatypes

With the introduction of object types in Oracle8, you can now use Oracle built-in datatypes and other user-defined datatypes to create arbitrarily complex types of your own that model closely the structure and behavior of data in systems.

Chapter 21 explores this powerful feature in more detail and explores how to take advantage of Oracle9i's addition of support for object type inheritance.

7.3 Declaring Program Data

Before you can make a reference to a variable constant, you must declare it. (The only exception to this rule is for the index variables of FOR loops.) All declarations must be made in the declaration section of your anonymous block, procedure, function, trigger, object type body, or package body. (See Chapter 3 for more details on the structure of the PL/SQL block and its declaration section.)

You can declare many types of data and data structures in PL/SQL, including variables, constants, TYPES (such as a type of collection or a type of record), and exceptions. This chapter focuses on the declarations of variables and constants. (See Chapter 11 for an explanation of TYPE statements. See Chapter 6 to learn how to declare exceptions.)

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]