void Exception::loadProperties(IBPP::Statement& statement, wxMBConv* converter) { setPropertiesLoaded(false); std::string message; statement->Get(2, message); messageM = wxString(message.c_str(), *converter); statement->Get(3, numberM); if (statement->IsNull(4)) setDescriptionIsEmpty(); setPropertiesLoaded(true); }
void Domain::loadProperties(IBPP::Statement& statement, wxMBConv* converter) { setPropertiesLoaded(false); statement->Get(2, &datatypeM); if (statement->IsNull(3)) subtypeM = 0; else statement->Get(3, &subtypeM); // determine the (var)char field length // - system tables use field_len and char_len is null // - computed columns have field_len/bytes_per_char, char_len is 0 // - view columns have field_len/bytes_per_char, char_len is null // - regular table columns and SP params have field_len/bytes_per_char // they also have proper char_len, but we don't use it now statement->Get(4, &lengthM); int bpc = 0; // bytes per char if (!statement->IsNull(14)) statement->Get(14, &bpc); if (bpc && (!statement->IsNull(8) || !statement->IsNull(13))) lengthM /= bpc; if (statement->IsNull(5)) precisionM = 0; else statement->Get(5, &precisionM); if (statement->IsNull(6)) scaleM = 0; else statement->Get(6, &scaleM); if (statement->IsNull(7)) charsetM = ""; else { std::string s; statement->Get(7, s); charsetM = std2wxIdentifier(s, converter); } bool notNull = false; if (!statement->IsNull(9)) { statement->Get(9, notNull); } nullableM = !notNull; hasDefaultM = !statement->IsNull(10); if (hasDefaultM) { readBlob(statement, 10, defaultM, converter); defaultM = trimDefaultValue(defaultM); } else defaultM = wxEmptyString; if (statement->IsNull(11)) collationM = wxEmptyString; else { std::string s; statement->Get(11, s); collationM = std2wxIdentifier(s, converter); } readBlob(statement, 12, checkM, converter); setPropertiesLoaded(true); }