By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,693 Members | 1,972 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,693 IT Pros & Developers. It's quick & easy.

Rules question

P: n/a
I am starting to work with rules. I think I have them down but the
folowing one is giving me grief. It tells me that it has rewritten 100
times and probably has looped. The columns ID and Location make up the
primary key so I am sure that the result update should only effect one
row. Anyone know what I am missing?

CREATE OR REPLACE RULE "set_changed" AS ON UPDATE TO "GameInformation"
WHERE NEW."Changed" =FALSE DO UPDATE "GameInformation" SET "Changed" = TRUE
WHERE "Location" = NEW."Location" AND "ID" = NEW."ID";

--- Adam Kavan
--- ak****@cox.net
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 11 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

On Mon, 15 Sep 2003, Adam Kavan wrote:
I am starting to work with rules. I think I have them down but the
folowing one is giving me grief. It tells me that it has rewritten 100
times and probably has looped. The columns ID and Location make up the
primary key so I am sure that the result update should only effect one
row. Anyone know what I am missing?


Rules are like a macro system, you can't generally get around loops by
using where conditions on the rule. You'll need to either break the
recursion by using something like a view or write the logic into a
before trigger.

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 11 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.