R rodmcm Active Member Licensed User Longtime User May 21, 2020 #1 In B4a I use ResultSet to capture a database Table, I then eliminate the information in the Table, reconfigure and store it in the same Table, with alterations using the data in the ResultSet. Works fine. B4X: Copy rsSorted = Starter.SQL.ExecQuery(Query) SQLGeneral.DeleteDataSQLTable(Starter.SQL,"SORTEDTERMS") ' Deletes the old data B4X: Copy 'Generalised sub to Delete all items from Table 'Does not delete the Table Sub DeleteDataSQLTable(SQL As SQL,DBname As Object) 'Log("Delete data from SQLDB") Dim Query As String = "DELETE FROM " & DBname SQL.ExecNonQuery(Query) End Sub If I try this with B4j then rsSorted has no data at all after the delete of the database Why would this be so?
In B4a I use ResultSet to capture a database Table, I then eliminate the information in the Table, reconfigure and store it in the same Table, with alterations using the data in the ResultSet. Works fine. B4X: Copy rsSorted = Starter.SQL.ExecQuery(Query) SQLGeneral.DeleteDataSQLTable(Starter.SQL,"SORTEDTERMS") ' Deletes the old data B4X: Copy 'Generalised sub to Delete all items from Table 'Does not delete the Table Sub DeleteDataSQLTable(SQL As SQL,DBname As Object) 'Log("Delete data from SQLDB") Dim Query As String = "DELETE FROM " & DBname SQL.ExecNonQuery(Query) End Sub If I try this with B4j then rsSorted has no data at all after the delete of the database Why would this be so?
LucaMs Expert Licensed User Longtime User May 21, 2020 #2 Perhaps you are checking the db in the assets, after executing the query (your routine). Check the db path. Upvote 0
Perhaps you are checking the db in the assets, after executing the query (your routine). Check the db path.
Erel B4X founder Staff member Licensed User Longtime User May 21, 2020 #3 You can use DBUtils.ExecuteMemoryTable to read the complete data into a list. It will then be kept after the data is deleted. Upvote 0
You can use DBUtils.ExecuteMemoryTable to read the complete data into a list. It will then be kept after the data is deleted.