Thursday, October 14, 2010

String Handling Functions - Part 1 By Andy Warren

In this video, within 6 min. 29 secs Andy not only shows the usage of Lower, upper, left, right, ltrim and ltrim functions but also displays a few what if scenarios which we may otherwise not think about if we just go by the book.

Here are my learnings:
  • upper and lower functions does not return an error when used with null data.
  • The second argument for left and right functions should be a positive value and cannot be a negative value.
  • If a negative value is used the select statement errors out.
  • If a zero is used as the second argument it does not return an error but it just returns a blank row.
  • There is no trim functions. If you need a trim function in sql then combine the ltrim and rtrim functions to get the desired result. Eg: rtrim(ltrim(@test))

No comments:

Databases and Data Visualisations Course for kids Week 1

As mentioned last week, I have started the Databases and Data Visualisations course for kids aged between 11 to 15 years yesterday. It was...