43 #define NCBI_USE_ERRCODE_X Dbapi_Variant
57 switch (GetErrCode()) {
232 FORMAT(
"Unsupported BigDateTime format " << fmt));
261 : m_data(0), m_exposed(
false)
281 "Illegal argument, the size of LONGCHAR should not be 0");
292 "Illegal argument, the size of CHAR should not be 0");
300 "Illegal argument, the size of LONGBINARY should not be 0");
311 "Illegal argument, the size of BINARY should not be 0");
352 string(
"Unsupported type: ")
358 : m_data(o), m_exposed(
true)
410 : m_data(0), m_exposed(
false)
434 "CVariant::ctor(): unsupported datetime type "
445 : m_data(0), m_exposed(
false)
453 : m_data(v.m_data), m_descr(std::move(v.m_descr)), m_exposed(v.m_exposed)
470 "CVariant::GetNonNullData(): null data");
518 s =
string((
char*)
b->Value(),
b->Size());
524 s =
string((
char*)vb->Value(), vb->DataSize());
568 size_t n = stream->
Size();
570 size_t n2 = stream->
PeekAt(&s[0], 0,
n);
972 m_exposed = v.m_exposed;
975 m_descr = std::move(v.m_descr);
989 string(
"Cannot compare different types ")
1025 string(
"Type not supported: ")
1042 string(
"Cannot compare different types ")
1083 string(
"Type not supported: ")
1101 ->GetBulkInsertionEnc();
static CDB_BigDateTime::ESQLType s_TranslateDateTimeFormat(EDateTimeFormat fmt)
static const char * str(char *buf, int n)
bool IsNull(void) const
Check if the object is unassigned.
@ eRetriable_No
It makes no sense to retry the action.
@ eNoOwnership
No ownership is assumed.
static bool IsBlobType(EDB_Type db_type)
virtual void AssignNULL()
const void * Value() const
virtual void AssignValue(const CDB_Object &v)=0
virtual CDB_Object * Clone() const =0
static const char * GetTypeName(EDB_Type db_type, bool throw_on_unknown=true)
virtual size_t PeekAt(void *buff, size_t start, size_t nof_bytes) const
virtual size_t Size() const
@ eDateTimeOffset
DATETIMEOFFSET (MS); no Sybase equivalent.
@ eDateTime
DATETIME2 (MS), BIGDATETIME (Sybase)
@ eTime
TIME (MS), (BIG)TIME (Sybase)
static CVariant DateTime(CTime *p)
CDB_Object * GetData(EOwnership ownership=eTakeOwnership) const
Get pointer to the data buffer.
CVariantException(const string &message)
virtual const char * GetErrCodeString(void) const override
bool MoveTo(size_t pos) const
bool operator==(const CVariant &v1, const CVariant &v2)
static CVariant Float(float *p)
double GetDouble(void) const
static CVariant BigDateTime(CTime *p, EDateTimeFormat fmt=eLonger)
void x_Inapplicable_Method(const char *method) const
static CVariant VarBinaryMax(const void *p, size_t len)
static CVariant BigInt(Int8 *p)
EBulkEnc GetBulkInsertionEnc(void) const
Uint1 GetByte(void) const
static CVariant VarChar(const char *p, size_t len=0)
static CVariant LongChar(const char *p, size_t len=0)
static CVariant LongBinary(size_t maxSize, const void *p, size_t len)
string GetNumeric(void) const
static CVariant VarBinary(const void *p, size_t len)
static CVariant Binary(size_t size, const void *p, size_t len)
static CVariant SmallInt(Int2 *p)
void x_Verify_AssignType(EDB_Type db_type, const char *cxx_type) const
static CVariant Double(double *p)
static CVariant VarCharMax(const char *p, size_t len=0)
string GetString(void) const
static CVariant Char(size_t size, const char *p)
size_t Append(const void *buf, size_t len)
string AsNotNullString(const string &v) const
static CVariant Numeric(unsigned int precision, unsigned int scale, const char *p)
float GetFloat(void) const
size_t Read(void *buf, size_t len) const
static CVariant Int(Int4 *p)
static CVariant TinyInt(Uint1 *p)
bool operator<(const CVariant &v1, const CVariant &v2)
void SetBulkInsertionEnc(EBulkEnc e)
void SetData(CDB_Object *o, EOwnership ownership=eNoOwnership)
Repoint data buffer.
void Truncate(size_t len=kMax_UInt)
class CDB_Object * m_data
CDB_Object * GetNonNullData(EOwnership ownership=eTakeOwnership) const
Get pointer to the data buffer.
CVariant & operator=(const CVariant &v)
size_t GetBlobSize() const
static CVariant SmallDateTime(CTime *p)
static CVariant Bit(bool *p)
const CTime & GetCTime(void) const
#define DIAG_COMPILE_INFO
Make compile time diagnostic information object to use in CNcbiDiag and CException.
#define NCBI_CATCH_ALL_X(err_subcode, message)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
virtual const char * GetErrCodeString(void) const
Get error code interpreted as text.
#define FORMAT(message)
Format message using iostreams library.
uint8_t Uint1
1-byte (8-bit) unsigned integer
int16_t Int2
2-byte (16-bit) signed integer
int32_t Int4
4-byte (32-bit) signed integer
int64_t Int8
8-byte (64-bit) signed integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string Int8ToString(Int8 value, TNumToStringFlags flags=0, int base=10)
Convert Int8 to string.
static string DoubleToString(double value, int precision=-1, TNumToStringFlags flags=0)
Convert double to string.
static const string BoolToString(bool value)
Convert bool to string.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
basic_string< TCharUCS2 > TStringUCS2
Type for string in UCS-2 encoding.
CTime & Clear(void)
Make the time "empty",.
string AsString(const CTimeFormat &format=kEmptyStr, TSeconds out_tz=eCurrentTimeZone) const
Transform time to string.
bool IsEmpty(void) const
Is time object empty (date and time)?
@ eEmpty
Use "empty" time.
enum ENcbiOwnership EOwnership
Ownership relations between objects.
Definition of all error codes used in dbapi libraries (dbapi_driver.lib and others).
const struct ncbi::grid::netcache::search::fields::SIZE size
GenericValue< UTF8<> > Value
GenericValue with UTF8 encoding.
static bool less(const CSeq_feat *A, const CSeq_feat *B)