You are not logged in.
Pages: 1

Hi @ab, I am working with revision 1.18.2716 and I having the error Error SQLITE_ERROR (1) [Step] using 3.13.0 - no such module: External, extended_errcode=1. I need create DB connections in a SQLite3 table and then I create the SQLDBConnectionProperties for external tables and create the same, I tried this two ways:
1) Create SQLite3 tables first and then external tables
  fModel = TSQLModel.Create([TSQLDBConnection, Table2], 'root');
  fServerRest := TSQLRestServerDB.Create(fModel, 'data.db', False);
  fServerRest.CreateMissingTables;
  
  // fill TSQLDBConnection with DB connection data ..
  fDBConnections = CreateAllConnectionProperties; // from TSQLDBConnection
  fSQLConnProp := fDBConnections.GetConnectionProp('ConnectionName');
  // create the external table
  fModel.AddTable(TSQLExternalTable);
  // map table and fields
  VirtualTableExternalMap(fModel, TSQLExternalTable, fSQLConnProp, 'EXTERNAL_TABLE').MapFields(['ID', 'ID']).MapAutoKeywordFields;
  // create missing tables again
  fServerRest.CreateMissingTables; // --> HERE THE EXCEPTION IS RAISED1) Create all tables and then drop the external tables for recreating
  fModel = TSQLModel.Create([TSQLDBConnection, Table2, TSQLExternalTable], 'root');
  fServerRest := TSQLRestServerDB.Create(fModel, 'data.db', False);
  fServerRest.CreateMissingTables;
  
  // fill TSQLDBConnection with DB connection data ..
  fDBConnections = CreateAllConnectionProperties; // from TSQLDBConnection
  fSQLConnProp := fDBConnections.GetConnectionProp('ConnectionName');
  // drop the external table from the SQLite3 database
  fServerRest.EngineExecute('drop table ExternalTable');
  // map table and fields
  VirtualTableExternalMap(fModel, TSQLExternalTable, fSQLConnProp, 'EXTERNAL_TABLE').MapFields(['ID', 'ID']).MapAutoKeywordFields;
  // create missing tables again
  fServerRest.CreateMissingTables; // --> HERE THE EXCEPTION IS RAISEDWhat I am doing wrong ? How I create tables in two phases in SQLite3 ?
Thanks in advance.
Esteban
Offline

Yes, I know that I am calling twice CreateMissingTables, I need create an initial table where I store the migrated DB connections and then create the connection properties for external tables.
I'll think another solution.
UPDATE: @ab, but if I drop the real SQLite3 table, that should not allow create the table again ?
Thanks.
Last edited by EMartin (2016-06-09 18:33:01)
Esteban
Offline

@ab, if I drop the real SQLite3 table, that should not allow create the table again ?
Thanks.
Esteban
Offline
Pages: 1