Aug 5, 2010 8:36 PM
How to handle Sql Server's REPLACE Function in Netezza
-
Like (0)
Is there a way to handle REPLACE Function in Netezza ?
Check the database user's guide. If the basic functions don't do what you want, get the SQL toolkit from your product engineer. It has scores of built-in functions that do everything you need.
Hi,
Translate command could be used to achive this. The syntax is as follows
select translate('name', 'nam', 'nem')
Hope this helps you.
Thanks,
S.Sampath Kumar
Be careful!!!! TRANSLATE is NOT the same as REPLACE (except in a small subset of cases).
There is a true REPLACE function available in the Netezza UDF library I think
D.
TRANSLATE is for 1-1 replacement.
e.g - translate(‘12345’,’14’,’ax’) returns ‘a23x5’.
I guess there is no REPLACE function available.
As noted by David Birmingham above - there is a true REPLACE function available in the SQL Toolkit.
D.
Hi David,
Can you please pin point me to that function? "Translate" function is not working in my case. i would need exact same "replace" function as in sql server in netezza.
Talk to your Netezza product engineer and ask for the SQL Toolkit. It has been recently released for TwinFin and has all the stuff you need. We have recently installed it and you get full access to regular expression operations, including replace, and lots more.

