Skip site navigation (1) Skip section navigation (2)

Re: can I update multiple table at a time?

From: Joshua Drake <jd(at)commandprompt(dot)com>
To: Jagadeesh <mnjagadeesh(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: can I update multiple table at a time?
Date: 2008-10-10 05:53:51
Message-ID: 20081009225351.0ccdaa3b@jd-laptop (view raw or flat)
Thread:
Lists: pgsql-admin
On Thu, 9 Oct 2008 22:12:04 -0700 (PDT)
Jagadeesh <mnjagadeesh(at)gmail(dot)com> wrote:

> Hello Gurus,
> 
> Is it possible to update two table using single sql statement? huh?
> let me be clear
> 
> I have table master with state and date field. And in history table I
> have same fields i.e., state and date. I'm writing an update statement
> to set 'open' state records  to 'closed' state after 7. both table can
> be joined using id.
> 
> Any thoughts?

Use a transaction?

> 
> Thanks
> 


-- 
The PostgreSQL Company since 1997: http://www.commandprompt.com/ 
PostgreSQL Community Conference: http://www.postgresqlconference.org/
United States PostgreSQL Association: http://www.postgresql.us/



In response to

pgsql-admin by date

Next:From: Julius TuskenisDate: 2008-10-10 06:06:18
Subject: Re: can I update multiple table at a time?
Previous:From: JagadeeshDate: 2008-10-10 05:12:04
Subject: can I update multiple table at a time?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group