[Gambas-user] DataView Help

Gianluigi gradobag at gradobag.it
Thu Jul 13 15:28:19 CEST 2023


Il 13/07/23 15:16, Benoit Minisini ha scritto:
> Le 13/07/2023 à 10:30, Gianluigi a écrit :
>> Hi Benoit,
>>
>> Sorry for the late reply, but I tried to do some testing.
>>
>> I am sure I am using the last well-compiled commit (I always delete 
>> the previous one).
>>
>
> OK, I see: it's because the student id is a serial field, so its 
> control has no value (it is generated by the server at insertion time).
>
> I don't think it's possible to get the last inserted record in that 
> case in a standard and database agnostic way... :-/
>
> There is a function that returns the last generated id in MySQL (for 
> example), but what if you have *two* auto increment fields in your table?
>
Hi Benoit,

If I understand correctly, this should not be a problem, just enter a 
non-serial long field and generate the key number yourself.

Is this so, is this enough to make it work on all databases?

Any suggestions on how to create the key or is MAX enough.

Thank you very much

Gianluigi



More information about the User mailing list