/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
if (bTypeChanged || bTypeNameChanged || bPrecisionChanged || bScaleChanged)
{ // If bPrecisionChanged this will only succeed if we have increased the // precision, otherwise an exception is thrown -- however the base // gui then offers to delete and recreate the column.
OUString sSql(getAlterTableColumn(rColName) + "TYPE " +
::dbtools::createStandardTypePart(rDescriptor, getConnection()));
getConnection()->createStatement()->execute(sSql); // TODO: could cause errors e.g. if incompatible types, deal with them here as appropriate. // possibly we have to wrap things in Util::evaluateStatusVector.
}
if (bIsNullableChanged)
{
sal_Int32 nNullable = 0;
rDescriptor->getPropertyValue(u"IsNullable"_ustr) >>= nNullable;
if (nNullable != ColumnValue::NULLABLE_UNKNOWN)
{
OUString sSql(getAlterTableColumn(rColName)); if (nNullable == ColumnValue::NULLABLE)
{
sSql += "DROP NOT NULL";
} elseif (nNullable == ColumnValue::NO_NULLS)
{
sSql += "SET NOT NULL";
}
getConnection()->createStatement()->execute(sSql);
} else
{
SAL_WARN("connectivity.firebird", "Attempting to set Nullable to NULLABLE_UNKNOWN");
}
}
if (bIsAutoIncrementChanged)
{
::dbtools::throwSQLException(
u"Changing autoincrement property of existing column is not supported"_ustr,
::dbtools::StandardSQLState::FUNCTION_NOT_SUPPORTED,
*this);
}
if (bDefaultChanged)
{
OUString sNewDefault;
rDescriptor->getPropertyValue(u"DefaultValue"_ustr) >>= sNewDefault;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.