[Gambas-user] gb.db local change

Christof Thalhofer chrisml at deganius.de
Sat Dec 10 19:21:19 CET 2022

Am 10.12.22 um 14:01 schrieb Benoit Minisini:

> Maybe that can be supported in standard. I imagine an optional boolean
> paramter to the Update() method: if set, then Update() returns a new
> 'Result' object made from the result of the RETURNING clause.
> Apparently RETURNING is supported by PostgreSQL, SQLite, and recent
> versions of MariaDB but just for INSERT.

PostgreSQL supports it for DELETE and UPDATE also.

Instead of a boolean parameter you could offer a string array called 
"Returning" which can hold the names of the columns whose content should 
be returned. If 'Returning' is filled it can be sent to the db:

If $Returning.Count > 0 Then
     $statement & " RETURNING " & $Returning.Join(',')

If the db doesn't support it, it will throw an error. So it's up to the 
programmer to distinguish whether the db or the current version of the 
db supports it or not.

Alles Gute

Christof Thalhofer

Dies ist keine Signatur

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221210/084c94ef/attachment.sig>

More information about the User mailing list