chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Awful ($db ...)


From: Peter Bex
Subject: Re: [Chicken-users] Awful ($db ...)
Date: Sun, 7 Oct 2018 13:20:29 +0200
User-agent: NeoMutt/20170113 (1.7.2)

On Sun, Oct 07, 2018 at 09:08:48PM +1000, David Ireland wrote:
> Hi,
> 
> I'm using the database access in Awful and I'm having the troubles
> recreating an example in the docs.  After setting up a dummy postgres
> database I tried this example:
> 
> ($db "insert into foo (bar, baz) values (?, ?)" values: '("bar-val" 
> "baz-val"))
> 
> Which produced this error:
> 
> <eval>          ($db "insert into foo (bar, baz) values (?, ?)" values:
> (quote ("bar-val" "baz-val")))        <--
> 
> Error: (get-last-result) ERROR:  syntax error at or near ","
> LINE 1: insert into foo (bar, baz) values (?, ?)

I don't know if Awful does any processing of the SQL string, but if it
does not, you will need to use the Postgres-native method of passing
parameterized values, which uses $1, $2 etc placeholders to refer to
the positional arguments.

Cheers,
Peter

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]