<div dir="ltr">Hallo Sylvia<div class="gmail_extra"><br></div><div class="gmail_extra">What about writing two rules with one update statement in each?<br></div><div class="gmail_extra">I'm rather used to Postgres 9: So there you would do that with INSTEAD OF TRIGGERs.<br>
</div><div class="gmail_extra"><br></div><div class="gmail_extra">--S.</div><div class="gmail_extra"><br><br><div class="gmail_quote">Am 24. Februar 2014 09:31 schrieb Sylvia Preuß <span dir="ltr"><<a href="mailto:sylvia.preuss@obk.de" target="_blank">sylvia.preuss@obk.de</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div lang="DE" link="blue" vlink="purple"><p class="MsoNormal">
Hello everybody,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I want to write into PostGIS database from a view in QGIS 2.0.1<u></u><u></u></p><p class="MsoNormal">I added in QGIS a PostGIS-layer, not from a table but from a view.<u></u><u></u></p>
<p class="MsoNormal">This view shows datas from 2 tables. I can insert a new object in QGIS and commit. But if I want to change the object in QGIS (UPDATE in PostGIS) I can update one table only. I can change the order of the update- statements in the rule and put the second one on the first place and always the first update- statements is successful. No matter how many INSERT-statements I put into the rule - all are successful. Why is it working to run more than one INSERT-statement and not more than one UPDATE-statement? <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">CREATE OR REPLACE RULE onupdate_qry_myview AS<u></u><u></u></p><p class="MsoNormal"> ON UPDATE TO myschema.qry_ myview DO INSTEAD ( <u></u><u></u></p><p class="MsoNormal">
INSERT INTO myschema.temptable (attributeyyy) <u></u><u></u></p><p class="MsoNormal"> VALUES (11);<u></u><u></u></p><p class="MsoNormal">INSERT INTO myschema.temptable (attributexxx) <u></u><u></u></p><p class="MsoNormal">
VALUES (15);<u></u><u></u></p><p class="MsoNormal"> UPDATE myschema.table1 SET attributezzz = 10<u></u><u></u></p><p class="MsoNormal"> WHERE table1.oid = 100;<u></u><u></u></p><p class="MsoNormal">UPDATE myschema.table2 SET attributezzz = 10<u></u><u></u></p>
<p class="MsoNormal"> WHERE table2.oid = 100;<u></u><u></u></p><p class="MsoNormal">);<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal" style="margin-bottom:12pt;line-height:12pt"><span style>PostgreSQL 8.1.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.0 (SUSE Linux)<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:12pt;line-height:12pt"><span style>PostGIS 1.3 <u></u><u></u></span></p><p class="MsoNormal" style="margin-bottom:12pt;line-height:12pt"><span style>QGIS 2.0.1 on Windows7<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-bottom:12pt;line-height:12pt"><span style="font-size:10pt;font-family:Verdana,sans-serif">Can somebody help? <br>Sylvia</span></p></div><br>_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br></blockquote></div><br></div></div>