Hi, On Sun, 7 Oct 2018 13:20:29 +0200 Peter Bex <pe...@more-magic.net> wrote:
> 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. Indeed, awful doesn't do anything to the SQL string. For Postgres, you have to use Postgres' syntax for placeholders. All the best. Mario -- http://parenteses.org/mario _______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users