Saw Mike's routine for counting occurences of a string in a string and I thought I'd offer a simpler solution.
Simply replace the occurence with null and use length differences as shown.
NOTE: len may ignore trailing spaces, so this can be made more solid by adding some non printable char (less likely to interfere with operation) to the end of the string being searched. (e.g. 'seach string here ' ->
'seach string here $' )
This can be wrapped in a function for utility.
A short but interesting article, the author has figured out a way to create a PDF from a stored procedure without using a third party library.