![](https://secure.gravatar.com/avatar/1b30afec8cd3efa4c7a10980c10315d8.jpg?s=120&d=mm&r=g)
6 Feb
2011
6 Feb
'11
7:10 p.m.
(sql (:insert-into 'kupci :set (:raw (if t (sql ('ime "a"))))))
The :insert-into clause expects the arguments to :set to be a multiple of two. You'll need to use sql-compile to do this.
(sql-compile `(:insert-into 'kupci :set ,@(when t (list 'ime "a"))))
How do I do it if I have multiple IFs like: (sql-compile `(:insert-into 'kupci :set ,@((if TEST (list 'ime "a") (if TEST2 (list 'prezime "b"))))) or how ? For every field in a database I want to test is even something entered and add that pair of field name and a value to the list. How do I do that ?