Version: 1.0.0
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);
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:
28  break;
29  case SYBDECIMAL:
30  case SYBFLTN:
31  case SYBMONEY:
32  case SYBMONEYN:
34  break;
35  case SYBVARCHAR:
36  case XSYBVARCHAR:
37  case XSYBNVARCHAR:
39  break;
40  case SYBVARBINARY:
41  case SYBBINARY:
42  case SYBIMAGE:
44  break;
45  case SYBDATETIME:
46  case SYBDATETIMN:
48  break;
49  default:
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
wxString GetColumnName()
wxTdsColumnData(TDSCOLUMN *pColumn)
wxString m_strColumnName