If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
as a moderator, i am quite familiar with the problem of people posting new questions in some unrelated thread, and i assure you, i would never do that
SELECT LENGTH(yourstring)
- LENGTH(REPLACE(yourstring,',','')) as number_of_commas
FROM ...
see? no UDF needed
Well excuse me. Your original post looks like an unrelated question. Maybe if you would have posted the above solution along with the question, it would have been more obvious. If this is just a one time request, then no UDF is necessary, but if it needs to be used frequently, I would still make it a UDF.
that would have required me to look up stuff in the manual, and i don't always feel like doing that
and of course i would look pretty silly posting a solution that doesn't work
REPLACE hasn't always been supported in DB2, which is why i asked -- i'm sure you know there are many different versions of DB2, and by asking the original poster to do the work of looking it up, i was simply trying to determine whether my solution had any chance of working