src-db/database/model/triggers/M_WAREHOUSE_TRG.xml
changeset 26789 f89eff26d185
parent 20233 934faa344e9e
child 26790 ef5da8dc7f38
--- a/src-db/database/model/triggers/M_WAREHOUSE_TRG.xml	Wed May 27 16:31:12 2015 +0200
+++ b/src-db/database/model/triggers/M_WAREHOUSE_TRG.xml	Wed May 20 18:17:08 2015 +0200
@@ -72,11 +72,13 @@
         ;
     END LOOP;
   ELSIF (UPDATING) THEN
-    UPDATE M_WAREHOUSE_ACCT SET AD_ORG_ID = :new.AD_ORG_ID
-    WHERE M_WAREHOUSE_ID = :new.M_WAREHOUSE_ID;
+    IF (:new.AD_ORG_ID <> :old.AD_ORG_ID) THEN
+      UPDATE M_WAREHOUSE_ACCT SET AD_ORG_ID = :new.AD_ORG_ID
+      WHERE M_WAREHOUSE_ID = :new.M_WAREHOUSE_ID;
     
-    UPDATE M_LOCATOR SET AD_ORG_ID = :new.AD_ORG_ID
-    WHERE M_WAREHOUSE_ID = :new.M_WAREHOUSE_ID;
+      UPDATE M_LOCATOR SET AD_ORG_ID = :new.AD_ORG_ID
+      WHERE M_WAREHOUSE_ID = :new.M_WAREHOUSE_ID;
+      END IF;
   END IF;
 END M_WAREHOUSE_TRG
 ]]></body>