[postmodern-devel] set

2011-02-28 Thread Haris
I have a query like this: (query (sql (:update 'kupci :set 'ime (parameter "ime") 'prezime (parameter "prezime") 'adresa (parameter "adresa") and I want now for the next parameter to check if something is passed, I tried (:raw (if (/= (length (parameter "sob

[postmodern-devel] sql-compile

2011-02-26 Thread Haris
What am I doing wrong here: (query (sql-compile `(:update 'kupci :set ,@(list 'ime (parameter "ime")) :where (:= 'id (parameter "id") I get from hunchentoot log: Database error 42883: function parameter(unknown) does not exist No function matches the

Re: [postmodern-devel] strange

2011-02-26 Thread Haris
>> (query (sql-compile `(:insert-into 'kupci :set >> ,@(list 'vrijemeunosa (:now) I put a quote before (:now) and it works now. Thanks ___ postmodern-devel mailing list postmodern-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listin

Re: [postmodern-devel] strange

2011-02-26 Thread Haris
>> (query (sql-compile `(:insert-into 'kupci :set >> ,@(list 'vrijemeunosa (:now) > This does not work from the repl either. You forgot a quote. It works in repl. What quote do you mean ? ___ postmodern-devel mailing list postmodern-devel@common-li

[postmodern-devel] strange

2011-02-25 Thread Haris
I have a query like: (query (sql-compile `(:insert-into 'kupci :set ,@(list 'vrijemeunosa (:now) If I try to execute it from repl it works but when called within function I get Undefined function :NOW called with arguments () ? ___ postmodern-deve

[postmodern-devel] :order-by

2011-02-22 Thread Haris
Hi. How to use :order-by (or :desc): (:select '* :from 'table :order-by 'column) doesn't work ? Thanks ___ postmodern-devel mailing list postmodern-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel

Re: [postmodern-devel] date

2011-02-20 Thread Haris
I found out that there is a timestamp type, that's what I really need. How do I do insert-into then with timestamp field: (:insert-into 'table :set 'ts :now) This doesn't work. How do I insert current date/time then ?___ postmodern-devel mailing list po

[postmodern-devel] date

2011-02-19 Thread Haris
Hi. I know this may not be the right place to ask such a question, can you give me a link to some postgresql mailing list, I found them many, I don't know which one to choose ? How to enter date and time in a date field ? Is there a default value for date field like current date and time ? Thanks

[postmodern-devel] update example

2011-02-17 Thread Haris
Hi. Can you just give me an update example with :where statement ? Thanks ___ postmodern-devel mailing list postmodern-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel

Re: [postmodern-devel] :set arguments

2011-02-06 Thread Haris
>> (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 mu

Re: [postmodern-devel] :set arguments

2011-02-05 Thread Haris
I simplified the example: (sql (:insert-into 'kupci :set (:raw (if t (sql ('ime "a")) and still getting the same error message. Why I can't combine insert-into and :set with (:raw ...) ? ___ postmodern-devel mailing list postmodern-devel@common-l

[postmodern-devel] :set arguments

2011-02-05 Thread Haris
(sql (:insert-into 'kupci :set (:raw (if (/= (length (parameter "ime")) 0) (sql ('ime (parameter "ime"))) For this I get an error: Invalid amount of :set arguments passed to insert-into sql operator Why is that ? Thanks ___ post

[postmodern-devel] query

2011-01-30 Thread Haris
I'm sorry for multiple threads. This subject was total misunderstanding by me. The thing that was confusing me was that if I don't enter a search term into the search field then it would not return that record even if some of the fields match. The right way is a dynamic query like this: (sql (:se

[postmodern-devel] query

2011-01-30 Thread Haris
I got it. I have to :or it with :is-null, like this: (sql (:select '* :from 'table :where (:or (:like 'field "%something%") (:is-null 'field ___ postmodern-devel mailing list postmodern-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailm

[postmodern-devel] query

2011-01-30 Thread Haris
I know what are you talking about, I read the Practical Common Lisp, I'm reading On lisp now but I didn't read all the Postmodern docs. (I know now what :raw does) What I really want is when the field is null to return true. (:is-null 'field) and what now ? Is there an expression "true" in sql ? I

[postmodern-devel] query

2011-01-29 Thread Haris
I made query like this: (sql (:select '* :from 'kupci :where (:and (:raw (if 'ime (sql (:like 'ime (concat-string "%" (parameter "ime") "%"))) t)) (:raw (if 'prezime (sql (:like 'prezime (concat-string "%" (parameter "prezime") %"))) t) but it doesn't work. For example, if (:like ...) for '

[postmodern-devel] query

2011-01-28 Thread Haris
Hi. I made a query like this: (sql (:select '* :from 'kupci :where (:and (:like 'ime (concat-string "%" (parameter "ime") "%")) (:like 'prezime (concat-string "%" (parameter "prezim

[postmodern-devel] plists

2011-01-26 Thread Haris
git clone http://marijnhaverbeke.nl/git/postmodern :plists works ok now. Thanks ___ postmodern-devel mailing list postmodern-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel

[postmodern-devel] plists

2011-01-26 Thread Haris
I tried git clone https://github.com/marijnh/Postmodern/commit/1627b8a8f8d19181112ba9d6b9eb544153318a32 but it doesn't work. What exactly should I write to get this from git ? ___ postmodern-devel mailing list postmodern-devel@common-lisp.net http://

[postmodern-devel] plists

2011-01-25 Thread Haris
Hi. I tried (query "select * from table1;" :plists) but I get: Error: Undefined operator NIL in form (NIL (CL-POSTGRES:EXEC-QUERY *DATABASE* "select * from table1;" (QUOTE POSTMODERN::SYMBOL-PLIST-ROW-READER))) What does that mean ? I'm using Lispworks/Windows. I also tried (query "select * f

[postmodern-devel] plists

2011-01-25 Thread Haris
Hi. I didn't quite understand the :plists argument. I want for select to return me lists of plists. I tried this: (query "select * from table1;" :plists t) but it doesn't work ? P.S. What's with the Croatia example ? I'm from Croatia. ___ postmodern-de

[postmodern-devel] id field

2011-01-24 Thread Haris
Then I don't need primary key ? If I choose my primary key to be an integer then I have to keep track of numbers and automatically insert number incremented by one ? I worked long ago with Access and it automatically inserts number incremented by one as id. I guess than this is part of Access progr

[postmodern-devel] id field

2011-01-24 Thread Haris
Hi. When I try to insert some data in table with (query "insert into ...") it asks me also to enter 'id' field which is a primary key. Shouldn't primary key field be automatically filed ? I made my table with pgadmin 3. Thanks ___ postmodern-devel mai