Calculating the Size of Field Buffers

Table 9-3 through Table 9-6 summarize the memory requirements for each data type. "L" is the length specified in the control file. "P" is precision. "S" is the size of the length indicator. For more information about these values, see "SQL*Loader Data Types".


Table 9-3 Fixed-Length Fields

Data Type Size in Bytes (Operating System-Dependent)

INTEGER

The size of the INT data type, in C

INTEGER(N)

N bytes

SMALLINT

The size of SHORT INT data type, in C

FLOAT

The size of the FLOAT data type, in C

DOUBLE

The size of the DOUBLE data type, in C

BYTEINT

The size of UNSIGNED CHAR, in C

VARRAW

The size of UNSIGNED SHORT, plus 4096 bytes or whatever is specified as max_length

LONG VARRAW

The size of UNSIGNED INT, plus 4096 bytes or whatever is specified as max_length

VARCHARC

Composed of 2 numbers. The first specifies length, and the second (which is optional) specifies max_length (default is 4096 bytes).

VARRAWC

This data type is for RAW data. It is composed of 2 numbers. The first specifies length, and the second (which is optional) specifies max_length (default is 4096 bytes).



Table 9-4 Nongraphic Fields

Data Type Default Size Specified Size

(packed) DECIMAL

None

(N+1)/2, rounded up

ZONED

None

P

RAW

None

L

CHAR (no delimiters)

1

L + S

datetime and interval (no delimiters)

None

L + S

numeric EXTERNAL (no delimiters)

None

L + S



Table 9-5 Graphic Fields

Data Type Default Size Length Specified with POSITION Length Specified with DATA TYPE

GRAPHIC

None

L

2*L

GRAPHIC EXTERNAL

None

L - 2

2*(L-2)

VARGRAPHIC

4KB*2

L+S

(2*L)+S



Table 9-6 Variable-Length Fields

Data Type Default Size Maximum Length Specified (L)

VARCHAR

4 KB

L+S

CHAR (delimited)

255

L+S

datetime and interval (delimited)

255

L+S

numeric EXTERNAL (delimited)

255

L+S