Team Fly 

Page 10

As with most lists, after reading the preceding bullet points, you may wonder what else DBAs do with their time. As you work with the Oracle Database 10g, you will experience other activities that will plug the loopholes that may exist in the previous list.

CRITICAL SKILL 1.3
Learn the Basic Oracle Database 10g Data Types

Very early in one's journey through the world of Oracle Database 10g, it becomes time to learn its common data types. Regardless of one's past experiences in information technology, data types are nothing new. Let's look at the most common type of data that can be stored in the Oracle Database 10g, keeping in mind that the list is much longer than the one we present here.

varchar2

By far the most common data type, varchar2 allows storage of just about any character that can be entered from a computer keyboard. In earlier software solutions, we commonly referred to this as alphanumeric data. The maximum length of varchar2 is 4000 bytes or characters. It is possible to store numeric data in this data type. This is a variable length character string, with no storing of trailing insignificant white space. Thus, if ''Turkey" is passed to a column defined as varchar2, it will store the text as "Turkey". The following listing shows a few sample varchar2 data definitions.

create table ... (
   name        varchar2(30),
   city        varchar2(30),
   ...
   ...
   state       varchar2(2));

If a program or SQL statement tries to store a set of characters in a varchar2 field that is longer than the field's specification, an error is returned and the statement abends.

number

The number data type allows the storing of integer as well as integer/decimal digits. When noninteger data is stored, the portion to the left of the decimal is referred to as precision, and that to the right as scale. The maximum precision is 38 and the maximum scale is 127. The confusing part of the specification of number data type comes into play when storing noninteger information. Table 1-1 illustrates this concept.

Team Fly 
0029-CRITICAL SKILL 1.3 Learn the Basic Oracle Database 10<em>g</em> Data Types