Prev | Current Page 267 | Next

Richard Niemiec

"Oracle Database 10g Performance Tuning Tips & Techniques"


The use of abstract datatypes increases the space requirements of your tables by eight bytes
for each datatype used. If a datatype contains another datatype, you should add eight bytes for
each of the datatypes.
Using Object Views
The use of abstract datatypes may increase the complexity of your development environment. When
you query the attributes of an abstract datatype, you must use a syntax different from the syntax
you use against tables that do not contain abstract datatypes. If you do not implement abstract
datatypes in all your tables, you will need to use one syntax for some of your tables and a separate
syntax for other tables??”and you will need to know ahead of time which queries use abstract
datatypes.
For example, the CUSTOMER table uses the ADDRESS_TY datatype described in the previous
section:
create table CUSTOMER
(Name VARCHAR2(25),
Address ADDRESS_TY);
The ADDRESS_TY datatype, in turn, has four attributes: Street, City, State, and Zip. If you want
to select the Street attribute value from the Address column of the CUSTOMER table, you may write
the following query:
select Address.Street from CUSTOMER;
However, this query will not work. When you query the attributes of abstract datatypes, you
must use correlation variables for the table names. Otherwise, there may be an ambiguity regarding
the object being selected. To query the Street attribute, use a correlation variable (in this case, ???C???)
for the CUSTOMER table, as shown in the following example:
select C.


Pages:
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279
DERMATOLOG KRAKÓW Prince lion cena online loans for bad credit rating aurora amefa tanie noclegi w polsce