2.2. Common Methods

2.2.1. Public Member Functions

2.2.1.1. dbl()

double dbl(void);

double dbl(const double default_value);

This function returns the value of the object as a double-precision floating-point number. If the object is null and default_value is given, it will be returned. If the object is null and default_value is not given, Value_Error will be thrown.

2.2.1.2. indicator()

sb2 indicator(void);

This function returns the Oracle indicator value for this object. sb2 is a signed two-byte integer type defined in oratypes.h and is typically signed short.

2.2.1.3. is_null()

void is_null(void);

This function returns true if this object is null; false otherwise.

2.2.1.4. lng()

long lng(void);

long lng(const long default_value);

This function returns the value of the object as a long integer. If the object is null and default_value is given, it will be returned. If the object is null and default_value is not given, Value_Error will be thrown.

2.2.1.5. maxsize()

int maxsize(void);

This function returns the maximum size for the internal representation of this object. For a Cursor object, it returns zero. For a Nullable object, it throws Value_Error.

This function is used by bind() and bind_col() to give information about the object to the OCI.

2.2.1.6. set_null()

void set_null(void);

This function sets the object to null.

2.2.1.7. sql_str()

string sql_str(void);

This function is similar to str(), except that for character types it surrounds the value with single quotes. If the object is null, "NULL" is returned.

The main purpose of this function is to provide Rowtype::operator<<() with an object's value in a way that is consistent with its type.

2.2.1.8. sqlt()

int sqlt(void);

This function returns the Oracle type value for this object as used in the OCI. If the object is a Nullable object, Value_Error is thrown.

This function is used by bind() and bind_col() to give information about the object to the OCI.

2.2.1.9. str()

string str(void);

string str(const string& default_value);

string str(const string& default_value, const Format& format_string);

This function returns the value of the object as a string. If the object is null and default_value is given, it will be returned. If the object is null and default_value is not given, Value_Error will be thrown. If format_string is specified, the output will be in this format. (Some Nullable-derived types ignore this value.)

Using str() rather than dbl() on a Number may return a floating-point number of greater precision since Oracle's internal representation of its NUMBER type is decimal rather than binary.

2.2.2. Private/Protected Member Functions

2.2.2.1. data()

void* data(void);

This protected function returns the address of the data representation of the object. It is used by Stmt objects to write data directly into the object as a result of a SELECT statement or an output placeholder in a PL/SQL block. For a Nullable object, it throws Value_Error.

This function is used by bind() and bind_col() to give information about the object to the OCI.

2.2.2.2. ind_addr()

sb2* ind_addr(void);

This protected function returns the address of the object's indicator variable. It is used by Stmt objects to write data directly into the object as a result of a SELECT statement or an output placeholder in a PL/SQL block. For a Nullable object, it throws Value_Error.

This function is used by bind() and bind_col() to give information about the object to the OCI.

2.2.3. Non-Member Functions

2.2.3.1. operator<<()

ostream& operator<<(ostream& output_stream, const Nullable& object_to_output);

These functions perform the output of the manipulator object.