[Gambas-user] DataView Help
chrisml at deganius.de
Tue Jul 11 21:11:27 CEST 2023
Am 11.07.23 um 15:56 schrieb Benoit Minisini:
> This is a feature of the underlying database system, so it's up to it to
> make that feature reliable! :-)
Hmm, I disagree. For instance with Postgresql it would only be
absolutely reliable if this:
> i = DataSource1.Connection.Exec(sSQL)
would have been encapsulated inside a transaction.
If 'students_id' is a serial, then the correct procedure would be to:
Start a transaction with "Begin;".
Get the next serial number of 'students_id' with
"select nextval(pg_get_serial_sequence('students', 'students_id')) as
Store the tuple together with students_id = new_id.
Commit the transaction with "Commit;".
If an error happened rollback the transaction with "Rollback;".
Other RDBMS may have other commands but act the same.
Dies ist keine Signatur
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 840 bytes
Desc: OpenPGP digital signature
More information about the User