10.12.2012 Views

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

External Datatypes<br />

is not an integer, the fractional part is discarded, and no error is returned. If the<br />

number to be returned exceeds the capacity of an unsigned integer for the operating<br />

system, <strong>Oracle</strong> returns an overflow on conversion error.<br />

VARCHAR<br />

The external datatype VARCHAR store character strings of varying length. The first<br />

two bytes contain the length of the character string, and the remaining bytes contain<br />

the actual string. The specified length of the string in a bind or a define call must<br />

include the two length bytes, meaning the largest VARCHAR string is 65533 bytes<br />

long, not 65535. For converting longer strings, use the LONG VARCHAR external<br />

datatype.<br />

VARCHAR2<br />

The external datatype VARCHAR2 is a variable-length string of characters up to 4000<br />

bytes.<br />

VARNUM<br />

The external datatype VARNUM is similar to the external datatype NUMBER, except<br />

that the first byte contains the length of the number representation. This length<br />

value does not include the length byte itself. Reserve 22 bytes to receive the longest<br />

possible VARNUM. You must set the length byte when you send a VARNUM value to<br />

the database.<br />

Table 4–4 VARNUM Examples<br />

Decimal<br />

Value<br />

Length<br />

Byte<br />

Exponent<br />

Byte Mantissa Bytes<br />

0 1 128 N/A N/A<br />

5 2 193 6 N/A<br />

-5 3 62 96 102<br />

2767 3 194 28, 68 N/A<br />

-2767 4 61 74, 34 102<br />

100000 2 195 11 N/A<br />

1234567 5 196 2, 24, 46, 68 N/A<br />

Terminator<br />

Byte<br />

Datatypes 4-19

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

Saved successfully!

Ooh no, something went wrong!