Received: from neptun.sns-felb.debis.de (neptun.sns-felb.debis.de [53.122.101.2]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eAGFTDs73913 for ; Thu, 16 Nov 2000 10:29:13 -0500 (EST) (envelope-from jhartwig@debis.com) Received: by neptun.sns-felb.debis.de; id QAA03908; Thu, 16 Nov 2000 16:31:48 +0100 Received: from unknown(53.113.82.10) by neptun.sns-felb.debis.de via smap (V5.0) id xma003866; Thu, 16 Nov 00 16:31:43 +0100 Received: from mail1.b3.dsh.de (localhost [127.0.0.1]) by dshmail1.dsh.de (8.9.1/8.8.7) with ESMTP id QAA18868 for ; Thu, 16 Nov 2000 16:27:35 +0100 (MET) Received: from debis.com ([138.201.143.121]) by mail1.b3.dsh.de (8.10.0/8.10.0) with ESMTP id eAGFRZa06801 for ; Thu, 16 Nov 2000 16:27:35 +0100 Message-ID: <3A13FCE5.CAECBA6E@debis.com> Date: Thu, 16 Nov 2000 16:27:33 +0100 From: Jens Hartwig Organization: debis Systemhaus GEI X-Mailer: Mozilla 4.7 [de] (WinNT; I) X-Accept-Language: de MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: search and replace possible on SQL? References: <20001116162103.S22005@erm1.u-strasbg.fr> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200011/127 X-Sequence-Number: 158 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 =============================================