[Gambas-user] gb.db autoincrement ?

Doriano Blengino doriano.blengino at ...1909...
Sat Oct 18 09:47:16 CEST 2008


admin at ...1080... ha scritto:
> Hi Doriano
>
> With transactions there are many different lock levels, look at help.
>
> But in case you are using mySQL there is the function LAST_INSERT_ID (),
> see: 
> http://dev.mysql.com/doc/refman/5.1/en/information-functions.html#function_last-insert-id.
>
> Other vendors maybe have also functions or variables to catch the last 
> inserted id.
>   
Hi Werner,

thanks for your interest. Locks is the way to go, I will choose the 
right lock type; and transactions are good for database integrity; both 
are easy to use, so I will give them a try.

About the Last_insert_ID(), I read about this function, but it seems it 
is not implemented in gambas.
May be I can import it using "EXTERNAL sub (...) ..."; or perhaps is 
more simple to do a query, once a lock is in place.

What I would point out is that I do not need locks at application level 
- locks seem required because Last_insert_id is not available.


Regards,
Doriano





More information about the User mailing list