Re: [exim] Running a SQL Insert command

Top Page
Delete this message
Reply to this message
Author: Martin D Fraser
Date:  
To: exim-users
Subject: Re: [exim] Running a SQL Insert command
from is a reserved word in SQL.

Put square brackets round it.

INSERT INTO message_log ([msgid], [from], [to], [host], [ctime])
values ("msgid", "from", "to", "host" ,"ctime")}}

Oh, and it is single quotes.

Wow, my first message from this list and I can help. ;)

Good luck.


And it was said by Michael da Silva Pereira
> I tried double" and single' nothing makes a difference.
>
> I just put junk in for now, just word because i was assuming it might be
> tyhe varibles I had in there earlier.
>
> Thanks,
> Michael
>
>
> ----- Original Message -----
> From: "Jeremy Harris" <jgh@???>
> To: "exim-users @ exim. org" <exim-users@???>
> Sent: Thursday, April 07, 2005 3:40 PM
> Subject: Re: [exim] Running a SQL Insert command
>
>
>> Michael da Silva Pereira wrote:
>>> No Luck:
>>>
>>> Log file genreates:
>>> Warning: ACL "warn" statement skipped: condition test deferred: MYSQL:
>>> query failed: You have an error in your SQL syntax. Check the manual
>>> that corresponds to your MySQL server version for the right syntax to
>>> use
>>> near 'from, to, host, ctime) values ("msgid", "from", "to", "host" ,"\n
>>>
>>>
>>> config file looks like:
>>> begin acl
>>> acl_check_rcpt:
>>> accept hosts = :
>>>
>>> warn set acl_m9 = ${lookup mysql {INSERT INTO message_log \
>>> (msgid, from, to, host, ctime) \
>>> values \
>>> ("msgid", \
>>> "from", \
>>> "to", \
>>> "host" \
>>> ,"ctime")}}
>>
>> OK, that's a MySQL error (not an Exim one). What does MySQL require
>> for quoting of string values? I only speak PgSQL, I'm afraid,
>> but that need single-quotes.
>>
>> Or, did you really mean to try to put those strings in those fields?
>> Perhaps something more meaningful, made from Exim variables?
>>
>> - Jeremy
>>
>> --
>> ## List details at http://www.exim.org/mailman/listinfo/exim-users ##
>> Exim
>> details at http://www.exim.org/
>> ## Please use the Wiki with this list - http://www.exim.org/eximwiki/
>
>
> --
> ## List details at http://www.exim.org/mailman/listinfo/exim-users
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://www.exim.org/eximwiki/
>