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 50A8353794 for ; Thu, 7 Apr 2005 20:31:46 +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 82489-10 for ; Thu, 7 Apr 2005 19:31:37 +0000 (GMT) Received: from mail.liquidcore.com (mail.liquidcore.net [68.17.96.60]) by svr1.postgresql.org (Postfix) with ESMTP id 77579537DE for ; Thu, 7 Apr 2005 20:31:36 +0100 (BST) Received: (from root@localhost) by mail.liquidcore.com (8.13.1/8.12.10) id j37JVm7C023032 for pgsql-jdbc@postgresql.org; Thu, 7 Apr 2005 14:31:48 -0500 Received: from [192.168.0.81] (ppasalalinux.nqadmin.com [192.168.0.81]) by mail.liquidcore.com (8.13.1/8.12.10) with ESMTP id j37JVl6H022999 for ; Thu, 7 Apr 2005 14:31:47 -0500 Message-ID: <42558A87.10805@nqadmin.com> Date: Thu, 07 Apr 2005 14:31:19 -0500 From: Prasanth Reply-To: dbadmin@nqadmin.com User-Agent: Mozilla Thunderbird 1.0.2-1.3.2 (X11/20050324) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Updatable resultset with join query. X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-scanner: scanned for malicious content X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.051 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200504/48 X-Sequence-Number: 12655 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.