Archives of the TeradataForum
Message Posted: Wed, 22 Aug 2012 @ 19:17:26 GMT
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
|