Version: 1.0.0
src
database
tds
tds_columndata.cpp
Go to the documentation of this file.
1
#include "
wx/database/wxprec.h
"
2
3
#if wxUSE_DATABASE_TDS
4
5
wxTdsColumnData::wxTdsColumnData
(TDSCOLUMN* pColumn)
6
{
7
m_nColumnType
=
GetColumnType
(pColumn);
8
m_nColumnSize
=
GetColumnSize
(pColumn);
9
m_strColumnName
=
GetColumnName
(pColumn);
10
}
11
12
int
wxTdsColumnData::GetColumnType
(TDSCOLUMN* pColumn)
13
{
14
int
returnType =
wxResultSetMetaData::COLUMN_UNKNOWN
;
15
switch
(pColumn->column_type)
16
{
17
case
SYBSINT1:
18
//case SYBSINT2:
19
//case SYBSINT4:
20
//case SYBSINT8:
21
//case SYBSUINT1:
22
//case SYBSUINT2:
23
//case SYBSUINT4:
24
//case SYBSUINT8:
25
case
SYBINTN:
26
case
SYBNUMERIC:
27
returnType =
wxResultSetMetaData::COLUMN_INTEGER
;
28
break
;
29
case
SYBDECIMAL:
30
case
SYBFLTN:
31
case
SYBMONEY:
32
case
SYBMONEYN:
33
returnType =
wxResultSetMetaData::COLUMN_DOUBLE
;
34
break
;
35
case
SYBVARCHAR:
36
case
XSYBVARCHAR:
37
case
XSYBNVARCHAR:
38
returnType =
wxResultSetMetaData::COLUMN_STRING
;
39
break
;
40
case
SYBVARBINARY:
41
case
SYBBINARY:
42
case
SYBIMAGE:
43
returnType =
wxResultSetMetaData::COLUMN_BLOB
;
44
break
;
45
case
SYBDATETIME:
46
case
SYBDATETIMN:
47
returnType =
wxResultSetMetaData::COLUMN_DATE
;
48
break
;
49
default
:
50
returnType =
wxResultSetMetaData::COLUMN_UNKNOWN
;
51
break
;
52
};
53
54
return
returnType;
55
}
56
57
int
wxTdsColumnData::GetColumnSize
(TDSCOLUMN* pColumn)
58
{
59
return
pColumn->column_size;
60
}
61
62
wxString
wxTdsColumnData::GetColumnName
(TDSCOLUMN* pColumn)
63
{
64
// We might consider a version of ConvertFromUnicodeStream that excepts the string length parameter
65
//AML wxString colName(/*AML (wxChar*)*/pColumn->column_name, pColumn->column_namelen);
66
wxString colName(pColumn->column_name->dstr_s, pColumn->column_name->dstr_size);
67
return
colName;
68
}
69
70
#endif//wxUSE_DATABASE_TDS
wxprec.h
wxResultSetMetaData::COLUMN_INTEGER
Definition:
resultset_metadata.h:21
wxTdsColumnData::GetColumnSize
int GetColumnSize()
Definition:
tds_columndata.h:13
wxTdsColumnData::m_nColumnType
int m_nColumnType
Definition:
tds_columndata.h:21
wxTdsColumnData::GetColumnName
wxString GetColumnName()
Definition:
tds_columndata.h:14
wxResultSetMetaData::COLUMN_STRING
Definition:
resultset_metadata.h:22
wxTdsColumnData::GetColumnType
int GetColumnType()
Definition:
tds_columndata.h:12
wxResultSetMetaData::COLUMN_DATE
Definition:
resultset_metadata.h:26
wxTdsColumnData::wxTdsColumnData
wxTdsColumnData(TDSCOLUMN *pColumn)
wxResultSetMetaData::COLUMN_DOUBLE
Definition:
resultset_metadata.h:23
wxTdsColumnData::m_nColumnSize
int m_nColumnSize
Definition:
tds_columndata.h:22
wxTdsColumnData::m_strColumnName
wxString m_strColumnName
Definition:
tds_columndata.h:23
wxResultSetMetaData::COLUMN_BLOB
Definition:
resultset_metadata.h:25
wxResultSetMetaData::COLUMN_UNKNOWN
Definition:
resultset_metadata.h:19
Generated on Mon Aug 19 2019 16:14:37 for wxDatabase by
Doxygen
1.8.15