Patch level : 12.0 no-patch
Files correlati : ba2900 Commento : Quando esporto svuoto prima la tabella
This commit is contained in:
parent
b1517683ee
commit
29531fe057
@ -131,6 +131,7 @@ protected:
|
||||
bool create_tables() const;
|
||||
bool create_indexes() const;
|
||||
bool rko_outta_nowhere(const char* table_name) const;
|
||||
bool empty_tables(const char* table_name) const;
|
||||
// Funzioni di esportazione
|
||||
bool dir_gen() const;
|
||||
bool trc_gen() const;
|
||||
@ -571,6 +572,12 @@ bool TMSSQLExport_app::rko_outta_nowhere(const char* table_name) const
|
||||
return _db->sq_commit();
|
||||
}
|
||||
|
||||
bool TMSSQLExport_app::empty_tables(const char* table_name) const
|
||||
{
|
||||
const bool ok = _db->sq_set_exec(TString().cut(0) << "DELETE FROM " << table_name << ';');
|
||||
return ok && _db->sq_commit();
|
||||
}
|
||||
|
||||
bool TMSSQLExport_app::expor_gen() const
|
||||
{
|
||||
return rko_gen() && create_gen_ms() && dir_gen() && trc_gen();
|
||||
@ -642,12 +649,18 @@ int TMSSQLExport_app::export_tables()
|
||||
|
||||
for (; logicnum < endtab && check; logicnum++)
|
||||
{
|
||||
empty_tables(logic2table(logicnum));
|
||||
TString nome_tab = tab_name(logicnum, ditta_name);
|
||||
const RecDes& rd = prefix().get_recdes(logicnum);
|
||||
if (prefix().get_recdes(logicnum).NKeys <= 0)
|
||||
{
|
||||
log(2, TString("Il file ") << logicnum << " non esiste");
|
||||
continue;
|
||||
}
|
||||
TLocalisamfile table(logicnum);
|
||||
if(!file_valid(logicnum))
|
||||
{
|
||||
warning_box(TString("Impossibile esportare il file ") << logicnum);
|
||||
log(2, TString("Impossibile esportare il file ") << logicnum << ". Lunghezza record incoerente.");
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1075,7 +1088,8 @@ void TMSSQLExport_app::main_loop()
|
||||
message_box(TString("ERROR: Esportazione tabelle campo fallita") << (err >= 2? TString(":\n Errorre tabella ") << err : ""));
|
||||
}
|
||||
message_box("Migrazione effettuata correttamente!");
|
||||
} while (!loop);
|
||||
} while (loop);
|
||||
show_log();
|
||||
}
|
||||
else
|
||||
message_box("Fallita connessione");
|
||||
|
Loading…
x
Reference in New Issue
Block a user