[Gambas-user] How to know if a deletion from database succeded?

Benoit Minisini gambas at ...1...
Fri Oct 24 01:21:36 CEST 2008


On mercredi 08 octobre 2008, Doriano Blengino wrote:
> In my program I have to delete some records from a table (to rewrite
> them just after).
> If I issue something like:
>
>     res = db.Exec("delete from lotti where tcaus=2 and numfat=25")
>
> how can I know that the deletion has been executed without errors? Has
> the "res" variable any meaning after a deletion, or a error is raised in
> case of unsuccessful deletion?
>
> Thanks.
>

You know that the deletion was ok if you don't get any error. 

Of course, that is true only if the underlying database client library 
effectively returns an error if the delete request fails!

Regards,

-- 
Benoit Minisini




More information about the User mailing list