Received: from erm1.u-strasbg.fr (erm1.u-strasbg.fr [130.79.74.61]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eAGF41s72767 for ; Thu, 16 Nov 2000 10:04:01 -0500 (EST) (envelope-from bboett@erm1.u-strasbg.fr) Received: (qmail 16046 invoked by uid 501); 16 Nov 2000 15:21:03 -0000 Date: Thu, 16 Nov 2000 16:21:03 +0100 From: Bruno Boettcher To: pgsql-sql@postgresql.org Subject: search and replace possible on SQL? Message-ID: <20001116162103.S22005@erm1.u-strasbg.fr> Reply-To: bboett@erm1.u-strasbg.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0.1i X-Archive-Number: 200011/126 X-Sequence-Number: 157 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....