pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Boettcher <bboett@erm1.u-strasbg.fr>
To: pgsql-sql@postgresql.org
Subject: search and replace possible on SQL?
Date: Thu, 16 Nov 2000 16:21:03 +0100
Message-ID: <20001116162103.S22005@erm1.u-strasbg.fr> (raw)

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....



view thread (2+ messages)  latest in thread

Message-ID: <20001116162103.S22005@erm1.u-strasbg.fr>
Permalink:  ../20001116162103.S22005@erm1.u-strasbg.fr/
Also on:    postgresql.org/message-id/20001116162103.S22005@erm1.u-strasbg.fr

 · 

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: bboett@erm1.u-strasbg.fr
  Subject: Re: search and replace possible on SQL?
  In-Reply-To: <20001116162103.S22005@erm1.u-strasbg.fr>
  References: <20001116162103.S22005@erm1.u-strasbg.fr>

* 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