wrapper for internal Oracle NUMBER type More...
#include <ocipl.h>
Public Member Functions | |
SqlNumber () | |
SqlNumber (const oraclenumber *pnum) | |
SqlNumber (OCIError *errh, const TCHAR *s, const TCHAR *fmt=TEXT("99999999999999999999999999999999999999D99999999999999999999"), const TCHAR *nls_fmt=TEXT("NLS_NUMERIC_CHARACTERS='.,'")) | |
SqlNumber (OCIError *errh, double d) | |
SqlNumber (OCIError *errh, double d, OCIInd ind) | |
SqlNumber (OCIError *errh, int i) | |
SqlNumber (OCIError *errh, int i, OCIInd ind) | |
SqlNumber (ub1 *num_ptr, ub1 num_len) | |
const oraclenumber & | get_number () const |
oraclenumber * | get_ref () |
const oraclenumber * | get_ptr () const |
tstring | str (OCIError *errh, const TCHAR *fmt=TEXT("TM9"), const TCHAR *nls_fmt=TEXT("NLS_NUMERIC_CHARACTERS='.,'")) const |
operator OCINumber * () | |
operator const OCINumber * () const | |
int | get_int (OCIError *errh, int null=INT_NULL) const |
double | get_double (OCIError *errh, double null=0.) const |
bool | is_null () const |
bool | is_not_null () const |
const SqlInd & | ind () const |
SqlInd & | ind () |
Protected Attributes | |
oraclenumber | _val |
SqlInd | _ind |
wrapper for internal Oracle NUMBER type
Definition at line 1792 of file ocipl.h.
OCIPL::SqlNumber::SqlNumber | ( | const oraclenumber * | pnum ) |
Definition at line 498 of file ocipl.cpp.
References OCIPL::SqlValue::_ind, _val, OCIPL::oraclenumber::exp, OCIPL::oraclenumber::len, and OCIPL::SqlInd::set().
OCIPL::SqlNumber::SqlNumber | ( | OCIError * | errh, |
const TCHAR * | s, | ||
const TCHAR * | fmt = TEXT("99999999999999999999999999999999999999D99999999999999999999") , |
||
const TCHAR * | nls_fmt = TEXT("NLS_NUMERIC_CHARACTERS='.,'") |
||
) |
Definition at line 505 of file ocipl.cpp.
References OCIPL::SqlValue::_ind, _tcslen, _val, OCIPL::SqlInd::clear(), OCIPL::istspace(), OCIPL::oci_check_error(), OCIPL::SqlInd::set(), and str().
{ if (str) { while(istspace(*str)) ++str; if (*str) { sword res = OCINumberFromText(errh, (const OraText*)str, (ub4)_tcslen(str)*sizeof(TOraText), (const OraText*)fmt, (ub4)_tcslen(fmt)*sizeof(TOraText), (const OraText*)nls_fmt, (ub4)_tcslen(nls_fmt)*sizeof(TOraText), (OCINumber*)&_val); oci_check_error(errh, res); _ind.set(); } else _ind.clear(); } else _ind.clear(); }
OCIPL::SqlNumber::SqlNumber | ( | OCIError * | errh, |
double | d | ||
) | [inline] |
Definition at line 1802 of file ocipl.h.
References OCIPL::oci_check_error().
{ sword res = OCINumberFromReal(errh, &d, sizeof(d), (OCINumber*)&_val); oci_check_error(errh, res); _ind.set(); }
OCIPL::SqlNumber::SqlNumber | ( | OCIError * | errh, |
double | d, | ||
OCIInd | ind | ||
) | [inline] |
Definition at line 1810 of file ocipl.h.
References OCIPL::oci_check_error().
: SqlValue(ind) { if (ind != OCI_IND_NULL) { sword res = OCINumberFromReal(errh, &d, sizeof(d), (OCINumber*)&_val); oci_check_error(errh, res); } }
OCIPL::SqlNumber::SqlNumber | ( | OCIError * | errh, |
int | i | ||
) | [inline] |
Definition at line 1819 of file ocipl.h.
References OCIPL::oci_check_error().
{ sword res = OCINumberFromInt(errh, &i, sizeof(i), OCI_NUMBER_SIGNED, (OCINumber*)&_val); oci_check_error(errh, res); _ind.set(); }
OCIPL::SqlNumber::SqlNumber | ( | OCIError * | errh, |
int | i, | ||
OCIInd | ind | ||
) | [inline] |
Definition at line 1827 of file ocipl.h.
References OCIPL::oci_check_error().
: SqlValue(ind) { if (ind != OCI_IND_NULL) { sword res = OCINumberFromInt(errh, &i, sizeof(i), OCI_NUMBER_SIGNED, (OCINumber*)&_val); oci_check_error(errh, res); } }
OCIPL::SqlNumber::SqlNumber | ( | ub1 * | num_ptr, |
ub1 | num_len | ||
) | [inline] |
double OCIPL::SqlNumber::get_double | ( | OCIError * | errh, |
double | null = 0. |
||
) | const [inline] |
Definition at line 1879 of file ocipl.h.
References OCIPL::number_to_double().
{ if (is_null()) return null; else return number_to_double(_val, errh); // atof(str(true).c_str()); }
int OCIPL::SqlNumber::get_int | ( | OCIError * | errh, |
int | null = INT_NULL |
||
) | const [inline] |
Definition at line 1861 of file ocipl.h.
References OCIPL::number_to_int().
{ if (is_null()) return null; else return number_to_int(_val, errh); }
const oraclenumber& OCIPL::SqlNumber::get_number | ( | ) | const [inline] |
Definition at line 1843 of file ocipl.h.
Referenced by OCIPL::ResultIterator::get_number(), and OCIPL::SqlNumberArray::set_number().
{return _val;}
const oraclenumber* OCIPL::SqlNumber::get_ptr | ( | ) | const [inline] |
Definition at line 1846 of file ocipl.h.
Referenced by OCIPL::BindInput::BindInput().
{return &_val;}
oraclenumber* OCIPL::SqlNumber::get_ref | ( | ) | [inline] |
Definition at line 1845 of file ocipl.h.
Referenced by OCIPL::BindOutput::BindOutput(), and OCIPL::DefinePar::DefinePar().
{return &_val;}
const SqlInd& OCIPL::SqlValue::ind | ( | ) | const [inline, inherited] |
Definition at line 1244 of file ocipl.h.
Referenced by OCIPL::BindInput::BindInput(), OCIPL::BindOutput::BindOutput(), OCIPL::DefinePar::DefinePar(), OCIPL::OciDate::OciDate(), OCIPL::OciDateArray::set_date(), OCIPL::SqlDateTimeArray::set_datetime(), and OCIPL::SqlNumberArray::set_number().
{return _ind;}
SqlInd& OCIPL::SqlValue::ind | ( | ) | [inline, inherited] |
bool OCIPL::SqlValue::is_not_null | ( | ) | const [inline, inherited] |
Definition at line 1242 of file ocipl.h.
Referenced by OCIPL::SqlInt::operator int().
{return _ind.is_not_null();}
bool OCIPL::SqlValue::is_null | ( | ) | const [inline, inherited] |
OCIPL::SqlNumber::operator const OCINumber * | ( | ) | const [inline] |
OCIPL::SqlNumber::operator OCINumber * | ( | ) | [inline] |
tstring OCIPL::SqlNumber::str | ( | OCIError * | errh, |
const TCHAR * | fmt = TEXT("TM9") , |
||
const TCHAR * | nls_fmt = TEXT("NLS_NUMERIC_CHARACTERS='.,'") |
||
) | const [inline] |
Definition at line 1849 of file ocipl.h.
References OCIPL::number_to_str().
Referenced by OCIPL::SqlResult::get_string(), and SqlNumber().
{ if (_ind.is_not_null()) return number_to_str(_val, errh, fmt, nls_fmt); else return tstring(); }
SqlInd OCIPL::SqlValue::_ind [protected, inherited] |
Definition at line 1248 of file ocipl.h.
Referenced by OCIPL::OciDate::OciDate(), OCIPL::SqlString::operator=(), and SqlNumber().
oraclenumber OCIPL::SqlNumber::_val [protected] |
Definition at line 1888 of file ocipl.h.
Referenced by SqlNumber().