X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B8C2353696 for ; Thu, 7 Apr 2005 20:39:05 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 85721-04 for ; Thu, 7 Apr 2005 19:38:54 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 847BD53205 for ; Thu, 7 Apr 2005 20:38:53 +0100 (BST) Received: (qmail 11914 invoked from network); 7 Apr 2005 19:37:40 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 7 Apr 2005 19:37:40 -0000 Message-ID: <42558C49.9070407@fastcrypt.com> Date: Thu, 07 Apr 2005 15:38:49 -0400 From: Dave Cramer Reply-To: pg@fastcrypt.com Organization: Postgres International User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dbadmin@nqadmin.com Cc: pgsql-jdbc@postgresql.org Subject: Re: Updatable resultset with join query. References: <42558A87.10805@nqadmin.com> In-Reply-To: <42558A87.10805@nqadmin.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.031 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/49 X-Sequence-Number: 12656 Yes, not all result sets are updateable, only simple one table result sets are supported. This is in the spec. dave Prasanth wrote: >I am trying to get an updatable result set using a join query. >It does not work if I join it using where condition. >(FROM table1, table2 WHERE table1.id1 = table2.id2) > >If I do it using INNER JOIN it works partially. What I mean >is I can update one table but not the other. > >Example >sql = "SELECT table1.p_key, table1.name, table2.p_key, table2.f_key, table2.name >FROM table1 INNER JOIN table2 ON table1.p_key = table2.f_key;"; > >I will be able to update the columns in table1 but not in table2. > >sql = "SELECT table1.p_key, table1.name, table2.p_key, table2.f_key, table2.name >FROM table2 INNER JOIN table1 ON table1.p_key = table2.f_key;"; > >In this case I can update columns in table2 but not in table 1. > >So seems like the first table that comes in the FROM clause is updatable. > >Is this how is should work? > >Thanks, >-Prasanth. > > >---------------------------(end of broadcast)--------------------------- >TIP 7: don't forget to increase your free space map settings > > > > -- Dave Cramer http://www.postgresintl.com 519 939 0336 ICQ#14675561