Oct 5, 2009 9:56 AM
Netezza regexp
-
Like (0)
Hi Guys,
I am pretty new to Netezza and I thought you can give me some hints on my problem.
I need to extract substring containing full words from source column. I think the easiest way would be using regex for that.
1. I heard that Netezza SQL Extensions toolkit contains such - but I can't find any reference/manual etc. Do you know how do I get one?
2. Or, maybe there is some simpler way to split strings to substrings containing full words?
Any hints/ideas/info on 1 & 2 are appreciated.
Thanks!
You can download the SQL toolkit from the Netezza ntzftp.netezza.com. You'll need a login from support if you don't already have one.
The install is pretty straightforward.
Have you installed the library? The documentation is available from Netezza's ftp site if you have an account. If you do not have an account then contact Netezza support and they will give you one.
In addition to the regexp functions there are some nice functions for handling text parsing as well, for example:
array_split splits a varchar string on a given delimiter
array_count tells you how many elements are in the array
select array_count(array_split('the quick brown fox',' '));
array_count
-------------
4
get_value_[type] returns a value out of the array based on the index. type can be varchar, int, double, timestamp
select get_value_varchar(array_split('the quick brown fox',' '), 3);
get_value_varchar
-------------------
brown
array_combine merges data back together:
select array_combine(array_split('the quick brown fox',' '),'|');
array_combine
---------------------
the|quick|brown|fox
I'll look for netezza support then.
Thanks!
Can you please give me the filename/location on the NZ ftp site. Thanks.

