Function like translate in oracle

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Function like translate in oracle

Vinícius Rabelo
Hi,

I need one function to remove the accents from one column, like the translate function in oracle:
translate( pString, 'ÁÇÉÍÓÚÀÈÌÒÙÂÊÎÔÛÃÕËÜáçéíóúàèìòùâêîôûãõëü', 'ACEIOUAEIOUAEIOUAOEUaceiouaeiouaeiouaoeu');

How to make this in HSQLDB?

Thanks a lot

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
Reply | Threaded
Open this post in threaded view
|

Re: Function like translate in oracle

Fred Toussi-2
Currently there is no built-in function for this, but it may be added.
In the meantime, Write a function in SQL or Java.
 
Fred
 
SQL function body looks like this:
 
CREATE FUNCTION TRANSLATE(str VARCHAR(100000), source VARCHAR(1000), dest VARCHAR(1000) )
RETURNS VARCHAR(100000)
BEGIN ATOMIC
 
-- form a string using LOCATE and OVERLAY functions in a loop
 
-- return the string
END
 
 
On Sat, May 4, 2013, at 12:20, Vinícius Rabelo wrote:
Hi,
 
I need one function to remove the accents from one column, like the translate function in oracle:
translate( pString, 'ÁÇÉÍÓÚÀÈÌÒÙÂÊÎÔÛÃÕËÜáçéíóúàèìòùâêîôûãõëü', 'ACEIOUAEIOUAEIOUAOEUaceiouaeiouaeiouaoeu');
 
How to make this in HSQLDB?
 
Thanks a lot
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
_______________________________________________
Hsqldb-user mailing list
 

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user