Paul's SQLite Question

Paul Mulroney pmulroney at logicaldevelopments.com.au
Wed Jul 27 00:50:51 UTC 2022


Hi Das,

Thanks for your email.  I thought that might be the case. I stumbled upon the $lastrowid() method the other day, but I've never used it until now.

Regards,
Paul.


> On 26 Jul 2022, at 11:58 pm, Das Goravani <goravanis at gmail.com> wrote:
> 
> 
> Paul,
> 
> I use SQLite on my astrology app. And I use table classes to do it all.
> 
> To get the unique key field back I just use $lastrowid()
> 
> You put in that column as #NULL and SQLite then assigns nextval to it.
> 
> $lastrowid returns it.
> 
> SQLite expects to be single user, so there is no chance of other users records getting in there in-between to mess up which is the last row ID.
> 
> Even in multi user the chance that a record gets inserted in the intervening time is really slim. 
> 
> So $lastrowid is safe. 
> 
> That’s all I got on that matter. 
> 
> Do tvSessObjRef.$lastrowid() Returns irowid
> Calculate $cinst.[tvrsnfieldname] as irowid
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 


People used to laugh at me when I would say "I want to be a comedian", well nobody's laughing now.
-- 
Paul W. Mulroney                                            We Don't Do Simple Pty Ltd 
pmulroney at logicaldevelopments.com.au       Trading as Logical Developments
www.logicaldevelopments.com.au                   ACN 161 009 374 
Ph: +61 8 9458 3889                                       86 Coolgardie Street
                                                                         BENTLEY  WA  6102





More information about the omnisdev-en mailing list