[postmodern-devel] Inserting into an array

Marijn Haverbeke marijnh at gmail.com
Sun Jan 13 20:31:40 UTC 2013


This seems to work:

    (pomo:execute (:insert-into 'test2 :set 'id 1 'name "t2" 'stuff1
#(22 24 21 20) 'stuff2 #(#(2 4) #(6 7))))

Best,
Marijn

On Sun, Jan 13, 2013 at 6:58 AM, Sabra Crolleton
<sabra.crolleton at gmail.com> wrote:
> I thought I understood the s-sql syntax on inserting into an array. Then I
> tried it. No, I do not understand the s-sql array syntax for an insert-into
> statement.
>
> Does anyone have a simple example?
>
> As a sampe:
> (query (:create-table test2 ((id :type serial) (name :type text) (stuff1
> :type int4[]) (stuff1 :type int4[]))))
>
> What would be the equivalent s-sql to
>
> (query "insert into test2 values (1,'t2','{22,24,21,20}','{{2,4},{6,7}}')")
>
> Such that
>
> (query (:select (:[] 'stuff2 1 1) :from 'test2 :where (:= 'id 1)) :single)
> #2A((2 4))
>
> Thank you for any explanations or pointers.
>
> Sabra Crolleton
>
> _______________________________________________
> postmodern-devel mailing list
> postmodern-devel at common-lisp.net
> http://lists.common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel
>




More information about the postmodern-devel mailing list