D'oh! I have a hard time kicking out that old habit. And changing code after testing it too!
On Jan 2, 4:21 am, "Christian Vest Hansen" <karmazi...@gmail.com> wrote: > Well, one thing that sticks out (particularly to me) is the fact that > you forgot to put your doc-string *before* your [params*] list :) > (ahem) > > > > On Fri, Jan 2, 2009 at 8:21 AM, budu <nbudu...@gmail.com> wrote: > > > Hi, I was experimenting with clojure-contrib's sql features and found > > that there wasn't any update-values function. I've written my own and > > I'm sharing it here: > > > (defn update-values [table where column-names & values] > > "Update columns of a table with values. columns-names is a vector of > > column names (strings or keywords) and the rest of arguments are the > > values for those columns." > > (let [columns (map #(str (the-str %) " = ?") column-names) > > template (if (seq column-names) > > (apply str (interpose "," columns)) > > "")] > > (apply do-prepared > > (format "update %s set %s where %s" > > (the-str table) template where) > > [values]))) > > > It only send one set of values to do-prepared because of the where > > clause that would have to change according to each sets. I'm ready for > > your commentaries and/or suggestions. > > -- > Venlig hilsen / Kind regards, > Christian Vest Hansen. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---