Page 1 of 1

MariaDB RS updating oChild after append

Posted: Thu Oct 25, 2018 12:34 am
by fraxzi
Hi Masters,

I have oRs:oChild and oRs:oChild:oChild ..

but oRecA := oRs:oChild:Record(,.F.) and oRacB := oRs:oChild:oChild:Record(,.T.) was saved by oRecA:save() and oRecB:save(), the database confirms the update/appended but even with
oRs:SyncChild() or oRs:oChild:SyncChild(), or oRs:oChild:ReSync() oRs:oChild:oChild:ReSync() .... or :ReQuery or :Refresh() the content of oRs:oChild:oChild wasn't updated ???

I couldn't make a small sample since I rely on internal data.. but I know you get the point.

To make it short, how can I refresh/update the content of oRs:oChild:oChild?

:?: :?:

Re: MariaDB RS updating oChild after append

Posted: Thu Oct 25, 2018 12:12 pm
by nageswaragunupudi
I understood your point.
Let me check. I will get back to you.

Re: MariaDB RS updating oChild after append

Posted: Mon Oct 29, 2018 2:27 am
by fraxzi
nageswaragunupudi wrote:I understood your point.
Let me check. I will get back to you.
Hi Rao,

I did this:

Code: Select all

...
oRs:AddChild( oConnection:RowSet('pettyempl'), { "idfund = oRs:id" } )
oRs:AddChild( oConnection:RowSet('pettycash'), { "idfund = oRs:id AND idempl = oRs:oChild:idempl" } )
...
 
to update:

Code: Select all

...
oRs:oChild:ReQuery({ "idfund = "+cValToChar(aValue[1]) + " AND idempl = "+cValToChar(aValue[2]) })       
oRs:oChild:oChild:ReQuery({ "idfund = "+cValToChar(aValue[1]) + " AND idempl = "+cValToChar(aValue[2]) })
...
oRecFun := oRs:Record()
oRecEmp := oRs:oChild:Record()
oRecPet := oRs:oChild:oChild:Record()
...                                                  
 
This works but I have doubt if this was the optimized and proper way.. Please correct me.

:?: