Updatable resultset with join query.

From: Prasanth <dbadmin(at)nqadmin(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Updatable resultset with join query.
Date: 2005-04-07 19:31:19
Message-ID: 42558A87.10805@nqadmin.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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.

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2005-04-07 19:38:49 Re: Updatable resultset with join query.
Previous Message Bruce Raggett 2005-04-07 13:50:50 Version 8.0-310 and PreparedStatement.getParameterMetaData()