Skip navigation
23471 Views 4 Replies Latest reply: Aug 19, 2010 9:37 AM by Vijay Nori RSS
rmekic New Enzee 2 posts since
Oct 5, 2009
Currently Being Moderated

Oct 5, 2009 9:56 AM

Netezza regexp

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!

  • Joey Foley New Enzee 35 posts since
    Oct 23, 2006
    Currently Being Moderated
    1. Oct 5, 2009 11:37 AM (in response to rmekic)
    Re: Netezza regexp

    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.

  • Shawn Fox Enzee Exraordinaire 1,333 posts since
    Aug 15, 2006
    Currently Being Moderated
    2. Oct 5, 2009 11:57 AM (in response to rmekic)
    Re: Netezza regexp

    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

  • Currently Being Moderated
    4. Aug 19, 2010 9:37 AM (in response to Joey Foley)
    Re: Netezza regexp

    Can you please give me the filename/location on the NZ ftp site. Thanks.

More Like This

  • Retrieving data ...

Bookmarked By (0)