Mercurial > hg > orthanc-databases
view MySQL/Plugins/GetLastChangeIndex.sql @ 99:e92bc25b818f OrthancPostgreSQL-3.0
OrthancPostgreSQL-3.0
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 21 Jan 2019 17:22:52 +0100 |
parents | 48d445f756db |
children | 740d9829f52e |
line wrap: on
line source
CREATE TABLE GlobalIntegers( property INTEGER PRIMARY KEY, value BIGINT ); INSERT INTO GlobalIntegers SELECT 0, COALESCE(MAX(seq), 0) FROM Changes; CREATE TRIGGER ChangeAdded AFTER INSERT ON Changes FOR EACH ROW BEGIN UPDATE GlobalIntegers SET value = new.seq WHERE property = 0@ END;