[Gambas-user] Succesful multiple Insert return a failed Result

Gianluigi bagonergi at gmail.com
Tue Apr 7 17:10:12 CEST 2020


Il giorno mar 7 apr 2020 alle ore 17:02 Gianluigi <bagonergi at gmail.com> ha
scritto:

>
>
> Il giorno mar 7 apr 2020 alle ore 16:22 T Lee Davidson <
> t.lee.davidson at gmail.com> ha scritto:
>
>> On 4/7/20 8:10 AM, Benoît Minisini wrote:
>> > Le 07/04/2020 à 11:27, Yeshua Rodas a écrit :
>> >> Hello people.
>> >>
>> >> I'm having an issue working with SQLite.
>> >>
>> >> I have a particular function for insert a batch of data and return the
>> number of affected rows:
>> >>
>> [snip]>>
>> >
>> > Only SELECT queries return a Result object. You don't have access to
>> the number of inserted rows at the moment.
>> >
>>
>> If you need the number of rows inserted, one way might be to:
>> 1. Count the number of rows in the table before the operation, then
>> 2. Count the number of rows in the table after the operation, and
>> 3. Return the difference.
>>
>
> Maybe trying this...
>
>
I forgot this code:
  MBase.CloseDB()
after this in FMain.class:
  Print "The total records are "; MBase.$nTotalNumber; ", of which new ";
MBase.$nNewNumber

Regards
Gianluigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200407/1e135dbc/attachment.html>


More information about the User mailing list