.comment-link {margin-left:.6em;}

Oracle Sponge -- Now Moved To Wordpress

Please use http://oraclesponge.wordpress.com

Tuesday, May 10, 2005

More Trigger Fun

Another scenario that will not work in a multiuser environment. Seems like a case for an on-commit fast refresh materialized view defined as ...

Select COUNT (*) num_rows
FROM mytable
Where relationship = 'friend'
having count(*) > 2;

Place a check constraint on num_rows to say 1=0 and there you go ... multiuser compatibility for a multirow constraint.

4 Comments:

At 1:15 PM, Blogger Jeff Hunter said...

oh, so now you're answering questions by pointing people to your blog? Interesting...

 
At 2:45 PM, Blogger David Aldridge said...

It's a technique that might catch on!

Actually I posted on a similar issue a few days ago, and then earlier today when the same sort of question cropped up ... eventually I just couldn't stand the stress of no-one pointing out that triggers like that don't work in multiuser environments, so I linked back to the blog.

Come to think of it, it's kind of like answering questions on a blog just so you can link to books that your consultancy has published ... so obviously there's nothing unethical about it! Just for a laugh search here http://dba.ipbhost.com/index.php?act=Search&f=2 for posts that include the text "rampant-books"

 
At 3:33 PM, Blogger Niall said...

No

Just for a laugh search metalink for dba-oracle.com :(

 
At 10:38 PM, Blogger David Aldridge said...

Oooo, that's a good game, Niall. I like it.

 

Post a Comment

<< Home