File: trigger.sql

package info (click to toggle)
libdbix-runsql-perl 0.25-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 248 kB
  • sloc: perl: 786; sql: 26; makefile: 10
file content (16 lines) | stat: -rw-r--r-- 507 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-- This commented-out statement will not get passed through;
-- SECRET PRAGMA #foo will get passed through with the next statement
create table test (
    id integer unique not null,
    descr text default '',
    ts text
);

CREATE TRIGGER trg_test_1 AFTER INSERT ON test
     BEGIN
      UPDATE test SET ts = DATETIME('NOW')  WHERE rowid = new.rowid;
     END;

CREATE TRIGGER trg_test_2 AFTER INSERT ON test BEGIN
      UPDATE test SET ts = DATETIME('NOW')  WHERE rowid = new.rowid;
END;