[Tutor] Proper SQLite cursor handling?

Alan Gauld learn2program at gmail.com
Mon Jul 12 14:14:31 EDT 2021


On 12/07/2021 16:47, Dennis Lee Bieber wrote:
> Pity the current SQLite documentation is only HTML -- I'd prefer a PDF.
> 	I have both editions of "The Definitive Guide" (though even the 2nd ed
> is getting old). Personally, the 1st edition is the volume to have


I have the O'Reilly guide "Using SQLite" which is pretty good IMHO.

Its from 2010 and covers v3.6 and touches on the "new" 3.7 features.

The example it gives for a trigger also uses another table but should
work for the local table:

CREATE TRIGGER access_audit
BEFORE UPDATE ON access
FOR EACH ROW
BEGIN
   INSERT INTO audit VALUES (OLD.level, NEW.level, CURRENT_TIMESTAMP);
END;

I see no reason why you couldn't just change the table from 'audit' to
'access'
on the INSERT statement.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos



More information about the Tutor mailing list