translate function

From: "Don V(dot) Soledad" <don(dot)soledad(at)uratex(dot)com(dot)ph>
To: pgsql-general(at)postgresql(dot)org
Subject: translate function
Date: 2003-05-02 03:46:02
Message-ID: 5.2.0.9.0.20030502112838.02e48e50@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

good day!

how could i use the function translate to output the replacement of the
exact occurrence of the 2nd parameter?

for instance,
select translate('Juan dela Cruz C/O ABC Co.','C/O','c/o');
gives
translate
----------------------------
Juan dela cruz c/o ABc co.

i would like the output to be "Juan dela Cruz c/o ABC Co." instead of "Juan
dela cruz c/o ABc co." could i do this with the above function, or are
there any functions that could do this?

thank you very much!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-05-02 03:51:43 Re: Updating a table which is null doesn't work?
Previous Message Mark Kirkwood 2003-05-02 03:06:49 Re: qsort (was Re: Solaris)