Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Interfaces Odbc > Re: PostgreSQL ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 2301 of 2384
Post > Topic >>

Re: PostgreSQL does not sup****t updateable cursors

by richard.broersma@[EMAIL PROTECTED] ("Richard Broersma") Mar 3, 2008 at 06:31 AM

------=_Part_19846_4532381.1204554696125
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Sun, Mar 2, 2008 at 11:06 PM, Premsun Choltanwanich
<Premsun@[EMAIL PROTECTED]
>
wrote:

>  Dear All,
>
>      Regarding to my conversation on mailing list as shown below, Is my
> problem related with any function on psqlODBC ? And, How can I fix it?
>
>
No, the problem is not with the ODBC driver.  The problem is that views in
postgresql are static non-update-able by default.  So if you try to update
and record in a view using a cursor or any other sql statement, you will
get
an error.

This problem can be fixed if your view meets the following criteria:

1) your view is based on only one table

2) your create rules for your view that define how updates to the view are
to be handled/cascaded to the base table.
http://www.postgresql.org/docs/8.3/interactive/sql-createrule.html

3) since postgresql rules can only handle update statements that affect
only
one tuple at a time, your cursor must only be able to update one record at
a
time.


Regards,
Richard Broersma Jr.

------=_Part_19846_4532381.1204554696125
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Sun, Mar 2, 2008 at 11:06 PM, Premsun Choltanwanich &lt;<a
href="mailto:Premsun@[EMAIL PROTECTED]
">Premsun@[EMAIL PROTECTED]
>&gt;
wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt
0.8ex; padding-left: 1ex;">



<div style="margin: 4px 4px 1px; font-family: MS Sans Serif; font-style:
normal; font-variant: normal; font-weight: normal; font-size: 10pt;
line-height: normal; font-size-adjust: none; font-stretch: normal;">
<div>Dear All,</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; Regarding to my conversation on mailing list
as shown below, Is my problem related with any function on psqlODBC ? And,
How can I fix it?</div>
<div>&nbsp;</div></div></blockquote></div>No, the problem is not with the
ODBC driver.&nbsp; The problem is that views in postgresql are static
non-update-able by default.&nbsp; So if you try to update and record in a
view using a cursor or any other sql statement, you will get an error.<br>
<br>This problem can be fixed if your view meets the following
criteria:<br><br>1) your view is based on only one table<br><br>2) your
create rules for your view that define how updates to the view are to be
handled/cascaded to the base table.<br>
<a
href="http://www.postgresql.org/docs/8.3/interactive/sql-createrule.html">http://www.postgresql.org/docs/8.3/interactive/sql-createrule.html</a><br><br>3)
since postgresql rules can only handle update statements that affect only
one tuple at a time, your cursor must only be able to update one record at
a time.<br>
<br><br>Regards,<br>Richard Broersma Jr.<br>

------=_Part_19846_4532381.1204554696125--
 




 1 Posts in Topic:
Re: PostgreSQL does not sup****t updateable cursors
richard.broersma@[EMAIL P  2008-03-03 06:31:36 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Thu Jul 24 7:12:56 CDT 2008.