if ((column_type != SQLDATETIME && column_type != SQLDATETIM4) || MS_SQL_G(datetimeconvert)) {
- if (column_type == SQLDATETIM4) res_length += 14;
- if (column_type == SQLDATETIME) res_length += 10;
-
+ switch (column_type) {
+ case SQLDATETIM4 :
+ res_length += 14;
+ break;
+ case SQLDATETIME :
+ res_length += 10;
+ break;
+ case SQLMONEY :
+ case SQLMONEY4 :
+ case SQLMONEYN :
+ case SQLDECIMAL :
+ case SQLNUMERIC :
+ res_length += 5;
+ break;
+ }
+
res_buf = (unsigned char *) emalloc(res_length+1);
res_length = dbconvert(NULL,coltype(offset),dbdata(mssql_ptr->link,offset), res_length, SQLCHAR,res_buf,-1);
} else {
case SQLMONEY :
case SQLMONEY4 :
case SQLMONEYN :
+ case SQLDECIMAL :
+ case SQLNUMERIC :
res_length += 5;
break;
}