Postmodern Examples Table of Contents
The general rule of thumb on deciding whether to use prepared statements, is to use them unless you have sufficient reason not to. Prepared Statements are compiled before execution therefore lending to better performance, and increased security against SQL injection as the database server takes care of the encoding of special characters.
(defprepared sovereign-of (:select 'sovereign :from 'country :where
(:= 'name '$1))
:single!)(sovereign-of "The Netherlands");; => "Beatrix"
The bang at the end of the :single! keyword indicates throw an error if it returns more than one.