pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gary Stainburn <gary.stainburn@ringways.co.uk>
To: pgsql-sql@postgresql.org
Subject: Re: best way to swap two records (computer details)
Date: Wed, 23 Mar 2005 17:28:58 +0000
Message-ID: <200503231728.58173.gary.stainburn@ringways.co.uk> (raw)
In-Reply-To: <d1evm7$2g5i$1@news.hub.org>
References: <200503181325.23293.gary.stainburn@ringways.co.uk>
	<d1evm7$2g5i$1@news.hub.org>

On Friday 18 March 2005 4:32 pm, you wrote:
> How about a user defined function ???
>
> CREATE OR REPLACE FUNCTION harwareupdate(integer, integer) RETURNS
> BOOLEAN AS '
>
>     update pieces set p_name = \'LSALES1\', p_location = \'Mike
> Haley\', p_site = \'L\' where p_id = $1;
>
>     update pieces set p_name = \'SPARE\', p_location = \'spare\',
> p_site = \'L\'
>     where p_id = 2;
>

This isn't quite what I want.  I want to SWAP the p_name and p_location 
between the two records, not set them to static values.

Any help would be appreciated.
-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000     




view thread (7+ messages)  latest in thread

Message-ID: <200503231728.58173.gary.stainburn@ringways.co.uk>
Permalink:  ../200503231728.58173.gary.stainburn@ringways.co.uk/
Also on:    postgresql.org/message-id/200503231728.58173.gary.stainburn@ringways.co.uk

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: gary.stainburn@ringways.co.uk
  Subject: Re: best way to swap two records (computer details)
  In-Reply-To: <200503231728.58173.gary.stainburn@ringways.co.uk>

* 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