/ WriteColumn: make sure the bind buffer is updated. */ /
| 1066 | /* WriteColumn: make sure the bind buffer is updated. */ |
| 1067 | /***********************************************************************/ |
| 1068 | void ODBCCOL::WriteColumn(PGLOBAL g) |
| 1069 | { |
| 1070 | /*********************************************************************/ |
| 1071 | /* Do convert the column value if necessary. */ |
| 1072 | /*********************************************************************/ |
| 1073 | if (Value != To_Val) |
| 1074 | Value->SetValue_pval(To_Val, FALSE); // Convert the inserted value |
| 1075 | |
| 1076 | if (Buf_Type == TYPE_DATE) { |
| 1077 | struct tm tm, *dbtime = ((DTVAL*)Value)->GetGmTime(&tm); |
| 1078 | |
| 1079 | Sqlbuf->second = dbtime->tm_sec; |
| 1080 | Sqlbuf->minute = dbtime->tm_min; |
| 1081 | Sqlbuf->hour = dbtime->tm_hour; |
| 1082 | Sqlbuf->day = dbtime->tm_mday; |
| 1083 | Sqlbuf->month = dbtime->tm_mon + 1; |
| 1084 | Sqlbuf->year = dbtime->tm_year + 1900; |
| 1085 | Sqlbuf->fraction = 0; |
| 1086 | } else if (Buf_Type == TYPE_DECIM) { |
| 1087 | // Some data sources require local decimal separator |
| 1088 | char *p, sep = ((PTDBODBC)To_Tdb)->Sep; |
| 1089 | |
| 1090 | if (sep && (p = strchr(Value->GetCharValue(), '.'))) |
| 1091 | *p = sep; |
| 1092 | |
| 1093 | } // endif Buf_Type |
| 1094 | |
| 1095 | if (Nullable) |
| 1096 | *StrLen = (Value->IsNull()) ? SQL_NULL_DATA : |
| 1097 | (IsTypeChar(Buf_Type)) ? SQL_NTS : 0; |
| 1098 | |
| 1099 | } // end of WriteColumn |
| 1100 | |
| 1101 | /* -------------------------- Class TDBXDBC -------------------------- */ |
| 1102 |
nothing calls this directly
no test coverage detected