summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rwxr-xr-xsql/Pg-functions.sql16
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();