Re: Updating views : cannot figure out what goes wrong
От | Jaime Casanova |
---|---|
Тема | Re: Updating views : cannot figure out what goes wrong |
Дата | |
Msg-id | 20050117220828.48127.qmail@web50006.mail.yahoo.com обсуждение исходный текст |
Ответ на | Updating views : cannot figure out what goes wrong (Dirk Cleenwerck <dirk.cleenwerck@useitgroup.com>) |
Список | pgsql-novice |
--- Dirk Cleenwerck <dirk.cleenwerck@useitgroup.com> escribió: > Hi there, > > strSql = "CREATE VIEW bondetailtmp AS SELECT * FROM > bondetail WHERE > subbonnr=" & Forms!bonnentest!bonnr & ";" > cn.Execute strSql > strSql = "CREATE RULE bondetailtmpupd AS ON UPDATE > TO bondetailtmp " & _ > "DO INSTEAD NOTHING;" > cn.Execute strSql > strSql = "CREATE RULE bondetailtmpupd2 AS ON UPDATE > TO bondetailtmp " & _ > "WHERE OLD.subbonbeschrijving <> > NEW.subbonbeschrijving " & _ > "DO (UPDATE bondetail " & _ > "SET > subbonbeschrijving=NEW.subbonbeschrijving);" > cn.Execute strSql > Forms!bonnentest.bondetailtmp.Form.RecordSource = > "bondetailtmp" > > 476 2005-01-06 18:46:34ERROR: cannot update a view > > 476 2005-01-06 18:46:34HINT: You need an > unconditional ON UPDATE DO > INSTEAD rule. > Just like the message says to you: yo have to use CREATE RULE ... DO INSTEAD not just DO. If you just does CREAT RULE ... DO it will defaults to ALSO so it will try to update the view itself the DO INSTEAD says not to touch the view but instead of that do this stmnt. regards, Jaime Casanova _________________________________________________________ Do You Yahoo!? Información de Estados Unidos y América Latina, en Yahoo! Noticias. Visítanos en http://noticias.espanol.yahoo.com
В списке pgsql-novice по дате отправления: