pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jens Hartwig <jhartwig@debis.com>
To: pgsql-sql@postgresql.org
Subject: Re: search and replace possible on SQL?
Date: Thu, 16 Nov 2000 16:27:33 +0100
Message-ID: <3A13FCE5.CAECBA6E@debis.com> (raw)
References: <20001116162103.S22005@erm1.u-strasbg.fr>

Hello Bruno,

try the following:

  UPDATE journal
  SET description = 'Add '||description
  WHERE description LIKE '%PSF%;

Is this what you wanted?

Best regards, Jens Hartwig

Bruno Boettcher schrieb:
> 
> hello,
> 
> again fiddling around with SQL...
> wanted to loop over the Base search for Strings beginning with a
> sequence and replace that sequence with another one.....
> 
> tryed the following:
> update journal set description='Add '||(select id description from
> journal subq where subq.description like '%PSF%').description where id=
> subq.id;
> 
> but evidently it didn't parsed :D
> 
> so the questions are:
> 
> can i make somehow a subquery and reuse the colums ? the system tryed
> above doesnt seem satisfying .....
> 
> is there a way to achieve above functionality, or do i have to write a
> frontend to make this?
> 
> in fact what i want to do using perl syntax:
> $temp="Add ".$1 if /(PSF.*)$/;
> 
> --
> ciao bboett
> ==============================================================
> bboett@earthling.net
> http://inforezo.u-strasbg.fr/~bboett http://erm1.u-strasbg.fr/~bboett
> ===============================================================
> the total amount of intelligence on earth is constant.
> human population is growing....

=============================================
Jens Hartwig
---------------------------------------------
debis Systemhaus GEI mbH
10875 Berlin
Tel.     : +49 (0)30 2554-3282
Fax      : +49 (0)30 2554-3187
Mobil    : +49 (0)170 167-2648
E-Mail   : jhartwig@debis.com
=============================================



view thread (2+ messages)

Message-ID: <3A13FCE5.CAECBA6E@debis.com>
Permalink:  ../3A13FCE5.CAECBA6E@debis.com/
Also on:    postgresql.org/message-id/3A13FCE5.CAECBA6E@debis.com

 · 

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 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-sql@postgresql.org
  Cc: jhartwig@debis.com
  Subject: Re: search and replace possible on SQL?
  In-Reply-To: <3A13FCE5.CAECBA6E@debis.com>
  References: <20001116162103.S22005@erm1.u-strasbg.fr> <3A13FCE5.CAECBA6E@debis.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