05.11.2015 Views

Apress.Expert.Oracle.Database.Architecture.9i.and.10g.Programming.Techniques.and.Solutions.Sep.2005

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

556<br />

CHAPTER 12 ■ DATATYPES<br />

Summary<br />

In this chapter, we examined the 22 basic datatypes provided by <strong>Oracle</strong> <strong>and</strong> saw how they are<br />

physically stored <strong>and</strong> what options are available with each. We started with character strings,<br />

the most basic of types, <strong>and</strong> looked into considerations surrounding multibyte characters <strong>and</strong><br />

raw binary data. Next, we studied the numeric types, including the very precise <strong>Oracle</strong> NUMBER<br />

type <strong>and</strong> the new floating-point types provided with <strong>Oracle</strong> 10g <strong>and</strong> later.<br />

We also gave consideration to the legacy LONG <strong>and</strong> LONG RAW types, concentrating on how<br />

we might work around their existence, as the functionality provided by these types falls far<br />

short of that provided by the LOB types. Next, we looked at the datatypes capable of storing<br />

dates <strong>and</strong> times. We covered the basics of date arithmetic, a perplexing issue until you’ve seen<br />

it demonstrated. Lastly, in the section on DATEs <strong>and</strong> TIMESTAMPs, we looked at the INTERVAL type<br />

<strong>and</strong> how best to use it.<br />

The most detailed part of the chapter from a physical storage perspective was the LOB<br />

section. The LOB type is frequently misunderstood by developers <strong>and</strong> DBAs alike, so the bulk<br />

of the section was spent looking at how they are physically implemented as well as certain<br />

performance considerations.<br />

The last datatype we looked at was the ROWID/UROWID type. For what now should be obvious<br />

reasons, you should not use this datatype as a database column, since ROWIDs are not<br />

immutable <strong>and</strong> no integrity constraints could enforce the parent/child relationship. Rather,<br />

you want to store primary keys if you need to “point” to another row.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!