1.5. Statements Are Not Procedures

Declarative programming is not like procedural programming. We seek to keep the data correct by using constraints that exclude the bad data at the start. We also want to use data rather than computations to solve problems, because SQL is a data retrieval language and not a computational one.

As an example of the difference, the PASS-2006 SQL Server group conference has a talk on Common Language Resources (CLR) in that product. This is a proprietary Microsoft “feature” that lets you embed any of several procedural or OO languages inside the database. The example the speaker used was putting a Regular Expression object to parse an e-mail address as a constraint.

The overhead was high, execution time was slow, ...

Get Joe Celko's Thinking in Sets: Auxiliary, Temporal, and Virtual Tables in SQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.