pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedsearch and replace possible on SQL?
2+ messages / 2 participants
[nested] [flat]
* search and replace possible on SQL?
@ 2000-11-16 15:21 Bruno Boettcher <bboett@erm1.u-strasbg.fr>
2000-11-16 15:27 ` Re: search and replace possible on SQL? Jens Hartwig <jhartwig@debis.com>
0 siblings, 1 reply; 2+ messages in thread
From: Bruno Boettcher @ 2000-11-16 15:21 UTC (permalink / raw)
To: pgsql-sql
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....
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: search and replace possible on SQL?
2000-11-16 15:21 search and replace possible on SQL? Bruno Boettcher <bboett@erm1.u-strasbg.fr>
@ 2000-11-16 15:27 ` Jens Hartwig <jhartwig@debis.com>
0 siblings, 0 replies; 2+ messages in thread
From: Jens Hartwig @ 2000-11-16 15:27 UTC (permalink / raw)
To: pgsql-sql
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
=============================================
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2000-11-16 15:27 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-11-16 15:21 search and replace possible on SQL? Bruno Boettcher <bboett@erm1.u-strasbg.fr>
2000-11-16 15:27 ` Jens Hartwig <jhartwig@debis.com>
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