Re: [gnome-db] SQLite last_insert_id



"Vivien Malerba" <vmalerba gmail com> wrote:

> No, there is not, but it's easy to do, see the attached patch which
> I'll commit ASAP.

Thanks!
 
> > If it can not be implemented , how can I check if provider supports this or not?
> 
> You can't check if it's implemented, but if it's not, you'll get a
> warning and the returned value will always be NULL. 

This is what I know , but the point is to use pseudo code like this:

if(provider_supports(last_insert_id)) {
	return_last_insert_id(cnc);
} else {
	"SELECT id from table WHERE ...."
}

>Moreover I don't
> really like this function since the returned value's interpretation
> and usage depends on the DBMS.

OK, so should I depend on this function or it's better to select this ID when insert is
succesfully  done?

Piotras



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]