diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-09-12 14:46:23 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-09-12 14:46:23 +0000 |
commit | 360934c0f7cf9e2e0bf86272207b3b9cd878be26 (patch) | |
tree | f57091214ac1bb59623180508a56e933367fb7d9 /sql | |
parent | 9f686c9016b912ca3241f5c153b3b9bd9317ef26 (diff) |
New sl-stack changes extensions
Added parts notify trigger to pg-functions.sql
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@74 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'sql')
-rwxr-xr-x | sql/Pg-functions.sql | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sql/Pg-functions.sql b/sql/Pg-functions.sql index 4ae22270..4eea5011 100755 --- a/sql/Pg-functions.sql +++ b/sql/Pg-functions.sql @@ -252,3 +252,19 @@ END; ' language 'plpgsql'; -- end function -- +CREATE OR REPLACE FUNCTION trigger_parts_short() RETURNS TRIGGER +AS +' + +CREATE OR REPLACE FUNCTION trigger_parts_short() RETURNS TRIGGER +AS +BEGIN + IF NEW.onhand >= NEW.rop THEN + NOTIFY parts_short; + END IF; + RETURN NEW; +END; +' LANGUAGE PLPGSQL; + +CREATE TRIGGER parts_short AFTER UPDATE ON parts +FOR EACH ROW EXECUTE PROCEDURE trigger_parts_short(); |