/* -*- 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/.
*/
// there's also DefaultValue but not related to database directly, it seems completely internal to LO // so no need to test it // TODO: remainder -- these are all "optional" so have to detect presence and change. if (bTypeChanged || bTypeNameChanged || bPrecisionChanged || bScaleChanged || bIsNullableChanged
|| bIsAutoIncrementChanged)
{ // 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.
OUStringBuffer sSql(300);
sSql.append(getAlterTableColumnPart() + " MODIFY COLUMN `" + rColName + "` "
+ ::dbtools::createStandardTypePart(rDescriptor, getConnection()));
if (comphelper::getBOOL(rDescriptor->getPropertyValue(u"IsAutoIncrement"_ustr)))
sSql.append(" auto_increment");
// see ColumnValue: NO_NULLS = 0, NULLABLE = 1, NULLABLE_UNKNOWN // so entry required = yes corresponds to NO_NULLS = 0 and only in this case // NOT NULL if (comphelper::getINT32(rDescriptor->getPropertyValue(u"IsNullable"_ustr)) == 0)
sSql.append(" NOT NULL");
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.