Clementson's Blog

Bits and pieces (mostly Lisp-related) that I collect from the ether.

June 2004
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
May  Jul

CLSQL - Part 2

Tuesday, June 8, 2004

In my previous post, I discussed some of the advantages of CLSQL and how to install it. In this posting, I'll walk through an interactive, annotated session using CLSQL in order to illustrate some of the characteristics of working with CLSQL. My example will use a Sales Order header file (typically containing the customer and generic order information) and a Sales Order detail file (typically containing the individual items that are being purchased). There is a 1:n relationship between the header and the detail files and the columns in the tables are kept to a minimum for the purposes of this walk-through in order to keep things simple.

If you would like to see some more examples of how to use CLSQL, the CLSQL tutorial is quite useful. Also, the tremendous CommonSQL tutorial that Nick Levine gave at ILC2002 is an excellent introduction to CLSQL. Even though his tutorial is targetted towards Xanalys CommonSQL, the examples work equally well in CLSQL (with the occasional minor tweak).

In summary, the CLSQL package is quite easy to work with and allows you to use a mixture of functional and OO approaches in working with relational data. It provides high-performing native access to the underlying databases (as well as ODBC access as either an alternative or as a means to access databases that are not supported with a native API). Kevin Rosenberg (and contributors) are to be commended for an excellent package!

emacs Copyright © 2005 by Bill Clementson