[postmodern-devel] dynamically built queries

Ralf Mattes rm at seid-online.de
Wed Jan 23 20:05:59 UTC 2008


Hello list,

I need to create queries dynamically and seem to have run into a silly
showstopper. I want to create queries like ...

 SELECT tmp1.name, tmp1.value  as "{foo}bar" from baz  as tmp1;

... where both the table name alias ("tmp1") as well as the field name
alias ("{foo}bar") are _Strings_. Now, if i do:

 (sql-compile '(:dot "tmp1" value))
 --> "E'tmp1'.value"

which is definitely _not_ what i want. The same for:

 (sql-compile '(:as "tmp1" baz))
 --> "E'tmp1' AS baz"

If possible at all I'd like to avoid the (make-symbol "tmp1") and
similar workarrounds. Any ideas?

 TIA Ralf Mattes
 




More information about the postmodern-devel mailing list