Android Question Idea for Send Master & Detail tables via jRDC

incendio

Well-Known Member
Licensed User
Longtime User
Hello guys,

Suppose there are Master Detail tables which structure like these
B4X:
Create table Master (
   Id int primary key,
   Dt text not null,
   FrmN text not null,
   IsSnt int default 0 not null);

Create table Detail (
   Id int primary key,
   IdMst int not null,
   Ttl int default 0 not null);

To send data via jRDC to database server, usually, I combine data from Master & Detail with sql command
B4X:
Select a.Dt, a.FrmN, b.Ttl
from Master a, Detail b
where a.id = b.IdMst
and a.IsSnt = 0

Then send it to a temporary table on server that has a structure like this
B4X:
Create table Tmp(
   Id int primary key,
   Dt text not null,
   FrmN text not null,
   Ttl int default 0 not null,
   IsPrc int default 0 not null);

With this way, I can send data with ExecuteBatch and set IsSnt Field in Master table to value 1 only if there were no error during sending process.

Choose this way, to prevent data sent partially when there was an error in internet connection during sent process.

But there is a price for this, on a server, there must be a small application that process data again and then copy data from temporary table to real table.

I wonder if there are a way to send data directly to real table in server but still ensure data integrity.
 
Top