Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Wed, 22 Aug 2012 @ 19:17:26 GMT

  <Prev Next>   <<First <Prev Next> Last>>  

Subj:   Re: Number of times a string appears in a sentence
From:   Dempsey, Mike

You could probably do a ReplaceAll in your editor - replacing the word JOIN with the word JOIN ... ie. Not really changing anything. It would report how many changes were made.

This will only work if you have the source code in an editor though. It won't work if you want to do this within Teradata. In that case you would need to write a UDF to count the occurrences. (Unless someone has such a function already)

You may need to add spaces around it (eg ' JOIN ') to avoid cases where that sequence of characters occurs within another word ... but then you would need to ensure you did not use tabs or line ends before/after the keyword. (a regular expression Replace would solve that problem if your editor supports it.)

Mike Dempsey

  <Prev Next>   <<First <Prev Next> Last>>  
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 28 Jun 2020