From: Dave Cramer <pg@fastcrypt.com>
To: dbadmin@nqadmin.com
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Updatable resultset with join query.
Date: Thu, 07 Apr 2005 15:38:49 -0400
Message-ID: <42558C49.9070407@fastcrypt.com> (raw)
In-Reply-To: <42558A87.10805@nqadmin.com>
References: <42558A87.10805@nqadmin.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: pg@fastcrypt.com, dbadmin@nqadmin.com
Subject: Re: Updatable resultset with join query.
In-Reply-To: <42558C49.9070407@fastcrypt.com>
References: <42558A87.10805@nqadmin.com> <42558C49.9070407@fastcrypt.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox