I have a B4J procedure that works on a Firebird db connected via odbc, and everything works fine
Now I have created a new Sqlite db, containing some tables of the main db, identical structure, and I would like to enhance them by copying the data from the main db tables
I am using this code:
Sub Process_Globals
Public MyDB As SQL
end sub
Sub rigenera_db_sqlite_per_tablet(tel_richiedente As String)As String
Try
MyDB.Initialize2(Db_Driver_Class,Db_Jdbc_Url,Db_Username,Db_Password)
If MyDB.IsInitialized = True Then
Dim db1_destinazione As String=" [ODBC;Driver={SQLite3 ODBC Driver};Dsn=Peppa_Sqlite;Database=c:\peppa\peppa.db]"
Dim MyRs As ResultSet = MyDB.ExecQuery("delete from ARTICOLI in " & db1_destinazione )
Dim MyRs As ResultSet = MyDB.ExecQuery("INSERT INTO ARTICOLI in " & db1_destinazione & " select * FROM ARTICOLI")
MyRs.Close
End If
Catch
stato_db= "DB CONNECTION ERROR => " & LastException
End Try
End Sub
But at row "MyDB.ExecQuery("delete from ARTICOLI in " & db1_destinazione )" an error interrupts the code
Obviuosly Dsn=Peppa_Sqlite exist and it has been verified and is accessible correctly
Could you help me to compose a correct query for:
- delete the data of an external table, indicated via dsn odbc
- copy data from an internal table to an external table