2 Aug 2007 21:58
Symbolic SQL Syntax Tribulations
I'm having no end of headaches from trying to use the symbolic sql
syntax.
Example:
(do-cached-query ((coach-id user-id first-name last-name team-id)
[select ["coach_id"] ["user_id"] ["coach_first_name"]
["coach_last_name"] ["team_id"]
:from ["coaches"] :order-by ["coach_id"]])
(unless (eq user-id 0)
(let ((result (select ["email"] ["url"] ["pass"] ["newsletter"]
:from ["nuke_users"]
:where [= ["uid"] user-id])))
(when result
(format t "~A ~A ~A ~A ~A ~A~&" coach-id user-id first-name
last-name team-id result)))))
One minute that will compile fine another it won't or it won't execute.
I end up with an error like
"odd number of elements in keyword/value list: ([ "coach_id" ] [
"user_id" ] [
"coach_first_name" ]
[ ...)"
I've tried executing (enable-sql-reader-syntax) in multiple packages, I
have it as
(eval-when (:compile-toplevel :load-toplevel :execute)
(Continue reading)
RSS Feed