[Gambas-user] Adding results from different databases

gian bagoneo at libero.it
Sat Dec 24 10:04:48 CET 2022


Il 23/12/22 04:42, Safiur Rahman ha scritto:
> I am talking of results from two databases.
> 
> It would be better if there is some procedure to convert result to 
> Variant[] or Json without enumerating each record one by one. Like 
> Result.All() for all fields

Hi Safiur,

I also immediately thought of a variant vector, but I was getting the 
table count and that's where I got stuck.

This code does the trick:

Private Sub Count_Read() As Integer

   Dim I As Integer

   For I = 0 To $aResult.Max
     $iCount += $aResult[I].Count
   Next

   Return $iCount

End

and after reading it I called myself stupid, especially thinking that 
Benoit must have created it without having to think about it, with one 
hand tied behind his back, while playing cards and sipping a beer 
(loosely taken from a sentence written by a Spanish friend) :-)

I wish you a good day

Gianluigi


More information about the User mailing list