Hello Everyone
I'm trying to understand how best to update SQLite from a B4xtable and would like some advice.
I'm struggling slightly because the help docs b4xtable help is showing nothing for me for some reason, plus the closest examples I've found
B4xTable load data - loads from sqllite but doesn't update SQL
B4xTable editable form -loads and writes from csv, but it seems to me at B4xtable close, that it writes the entire contents of B4xtable to csv which may of course not be suitable for SQLite ?
So I've written a new version of the load SQL example above, to contain three separate B4xtables to see what happens. Each B4xTable is built on button click and loads from the same SQLite table
If B4xTable 1 is updated a Sql.ExecNonQuery2 takes place immediately after the B4XTable1.sql1.ExecNonQuery2 in the CellLongClicked to update SQLite after you have changed a value using an inputtemplate on an individual cell
If B4xTable2 is modified then the update takes place in the DataUpdated event (whenever any data is updated on the visible screen?), - again after you have changed a value using an inputtemplate on an individual cell
If B4xtable3 is modified it holds the values as you move from B4xtable3 screens (next, previous etc) but loses values if move to another B4xtable (as expected as the data updates only exists in the b4xtable3 memory)
I expect it may depend on the what the B4xtables are used for, but my questions are:
Thanks in advance
I'm trying to understand how best to update SQLite from a B4xtable and would like some advice.
I'm struggling slightly because the help docs b4xtable help is showing nothing for me for some reason, plus the closest examples I've found
B4xTable load data - loads from sqllite but doesn't update SQL
B4xTable editable form -loads and writes from csv, but it seems to me at B4xtable close, that it writes the entire contents of B4xtable to csv which may of course not be suitable for SQLite ?
So I've written a new version of the load SQL example above, to contain three separate B4xtables to see what happens. Each B4xTable is built on button click and loads from the same SQLite table
If B4xTable 1 is updated a Sql.ExecNonQuery2 takes place immediately after the B4XTable1.sql1.ExecNonQuery2 in the CellLongClicked to update SQLite after you have changed a value using an inputtemplate on an individual cell
If B4xTable2 is modified then the update takes place in the DataUpdated event (whenever any data is updated on the visible screen?), - again after you have changed a value using an inputtemplate on an individual cell
If B4xtable3 is modified it holds the values as you move from B4xtable3 screens (next, previous etc) but loses values if move to another B4xtable (as expected as the data updates only exists in the b4xtable3 memory)
I expect it may depend on the what the B4xtables are used for, but my questions are:
- Are either or both of the first two valid options, or is one better than the other?
- Is there anything else I should consider (as it's a multiple update, should SQL1.BeginTransaction be used on the 2nd table for example?)
- Would a delete and recreate table (on activity pause If UserClosed be valid like the CSV example) be valid in some circumstances?
Thanks in advance
Attachments
Last edited: