Counting Character Instances in a SQL String

I discovered this little trick today. If you’re wanting to count the number of characters present in a given SQL Server varchar variable, or common, use the following convention –assuming a search character contained in the variable @SeekChar –from a variable SELECT LEN(@StringVariableName) – LEN(REPLACE(@StringVariableName,@SeekChar,”)) –from a table field SELECT … Continue reading

Listing Errors On Oracle

Been a bit quiet of late, so here’s something for the notepad to kick off new year. Image via Wikipedia Upon compiling a custom type into an Oracle schema, I was left with an  “Invalid Object” error message when attempting to use it. Error: PLS-00905: object MY_SCHEMA.MY_TYPE is invalid Line: … Continue reading