SQL query tool question

Started by jeremyc, January 10, 2007, 06:36:14 AM

Previous topic - Next topic

jeremyc

In my time of looking at different languages, one Scheme version had a SQL query generation package that I thought made working with SQL easier. For instance:



(sql:select '(a.name a.age b.date) '((as a person) (as b dobs)) '((= a.id b.id)))



I was thinking of making something similar in newLISP, but I am running into a problem with things like '((= a.id b.id)) ... I am not good with the quoting, unquoting, etc... yet. Maybe this project is beyond my skill, but how can I actually parse the (= a.id b.id) portion? or another example would be:



(sql:select '(a.name (count a.id)) ...)



the (count a.id) should obviously turn into COUNT(a.id) for SQL.



Thanks for any info.



Jeremy

Lutz

#1
This program: http://newlisp.org/index.cgi?page=S-expressions_to_XML">http://newlisp.org/index.cgi?page=S-expressions_to_XML is a good example how to translate LISP S-expressions into something else, like SQL in your case instaed of XML in the example.



Lutz