Using Advanced SQL Value Expressions
IN THIS CHAPTER
Using the CASE conditional expressions
Converting a data item from one data type to another
Saving data-entry time by using row value expressions
SQL is described in Chapter 2 as a data sublanguage. In fact, the sole function of SQL is to operate on data in a database. SQL lacks many of the features of a conventional procedural language. As a result, developers who use SQL must switch back and forth between SQL and its host language to control the flow of execution. This repeated switching complicates matters at development time and negatively affects performance at run time.
The performance penalty exacted by SQL’s limitations prompts the addition of new features to SQL every time a new version of the international specification is released. One of those added features, the
CASE expression, provides a long-sought conditional structure. A second feature, the
CAST expression, facilitates data conversion in a table from one type of data to another. A third feature, the row value expression, enables you to operate on a list of values where previously you could operate only on a single value. For example, if your list of ...