本文整理汇总了C++中FLTableMetaData::alias方法的典型用法代码示例。如果您正苦于以下问题:C++ FLTableMetaData::alias方法的具体用法?C++ FLTableMetaData::alias怎么用?C++ FLTableMetaData::alias使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FLTableMetaData
的用法示例。
在下文中一共展示了FLTableMetaData::alias方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: alterTable
//.........这里部分代码省略.........
}
QSqlQuery q(QString::null, db_->dbAux());
if (!q.exec("CREATE TABLE " + renameOld + " AS SELECT * FROM " + oldMTD->name() + ";") || !q.exec("DROP TABLE " + oldMTD->name() + ";")) {
#ifdef FL_DEBUG
qWarning("FLManager::alterTable : " + QApplication::tr("No se ha podido renombrar la tabla antigua."));
#endif
db_->dbAux() ->rollback();
if ((oldMTD != newMTD) && oldMTD)
delete oldMTD;
if (newMTD)
delete newMTD;
return false;
}
if (!db_->manager()->createTable(newMTD)) {
db_->dbAux() ->rollback();
if ((oldMTD != newMTD) && oldMTD)
delete oldMTD;
if (newMTD)
delete newMTD;
return false;
}
QSqlCursor oldCursor(renameOld, true, db_->dbAux());
oldCursor.setMode(QSqlCursor::ReadOnly);
QSqlCursor newCursor(newMTD->name(), true, db_->dbAux());
newCursor.setMode(QSqlCursor::Insert);
oldCursor.select();
int totalSteps = oldCursor.size();
QProgressDialog progress(QApplication::tr("Reestructurando registros para %1...").arg(newMTD->alias()), 0, totalSteps, qApp->focusWidget(), 0, true);
progress.setCaption(QApplication::tr("Tabla modificada"));
int step = 0;
QSqlRecord *newBuffer;
QString sequence;
fieldList = newMTD->fieldList();
FLFieldMetaData *newField = 0;
if (!fieldList) {
#ifdef FL_DEBUG
qWarning("FLManager::alterTable : " + QApplication::tr("Los nuevos metadatos no tienen campos."));
#endif
db_->dbAux() ->rollback();
if ((oldMTD != newMTD) && oldMTD)
delete oldMTD;
if (newMTD)
delete newMTD;
return false;
}
if (fieldList->isEmpty()) {
#ifdef FL_DEBUG
qWarning("FLManager::alterTable : " + QApplication::tr("Los nuevos metadatos no tienen campos."));
#endif
db_->dbAux() ->rollback();
if ((oldMTD != newMTD) && oldMTD)
delete oldMTD;
if (newMTD)
delete newMTD;
return false;