quick server pages
   
Manual page for lists(TDH)

Comma-delimited lists

A comma-delimited list (or "list" for short) is a list of items, delimited with commas like this: Harry,Ron,Hermione

Lists are useful in storing sets or groups. They can serve some of the same purposes that arrays serve in other languages. In databases, lists can conveniently provide a degree of vectorization without requiring a separate table and joins. Lists can be a powerful approach-- the infamous programming language LISP made great use of lists.

There are a number of functions for working with lists.

Lists can be used...

  • as sets of items.. members can be added or removed from lists.
  • to control iteration (#for loops)

In QUISP/SHSQL, lists can be used...

  • with <select multiple> CGI form fields. The #optionlist directive allows <select multiple> boxes to be initialized directly by a list. When a form is submitted <select multiple> responses can be converted to a list in the form target page using the #cgilistvar directive.
  • in WHERE clauses along with the IN, INLIKE, and INRANGE comparison operators; SHSQL provides full index support for IN, INLIKE, and INRANGE
  • in databases to provide a limited degree of vectorization, a list of keywords associated with publications for instance. As long as a JOIN on the list field is never required, this approach can simplify front-end code. SHSQL allows such list fields to be indexed using a WORD index, and retrieved using CONTAINS in the WHERE clause, for full index support.

Since the total length of a comma-delimited list is limited to about 250 characters, lists are most suitable where individual values are known to be small in size (such as controlled-vocabulary tags or integer id numbers) and where it is known that there will not be a huge number of choices. List members can not contain embedded commas, and there is no provision for escaping a comma. List members can contain embedded spaces in most situations.


quick server pages    
Copyright Steve Grubb    


Markup created by unroff 1.0,    March 31, 2004.