Re: [exim] Mysql query variable question

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Warren Baker
日付:  
To: isolderj
CC: exim-users
題目: Re: [exim] Mysql query variable question
2009/3/17 <isolderj@???>

>
> i am trying to parse the UID in one query to a variable in another query
> but I keep getting a error.
>
> UID    = ${lookup mysql{SELECT user_id from usermaps where emailaddress =
> '$sender_address'}

>
> then I want to say
>
> ACTIVE_USER = ${lookup mysql{SELECT active FROM mail WHERE user_id = UID}
>
> it returns the right uid but I keep getting a
>
> MYSQL: query failed: Unknown column '<uid>' in 'where clause'. when it runs
> the second query.
>
> i am sure my problem is in the way I am doing the second query.




You are using a Macro for the UID sql query and that macro is then been used
in the 2nd query which will not work. exim -d will show you what is been
done. If you are using this in the ACL section, as you dont say, then what
you want to do is assign the UID sql query to an acl variable (acl_m_XXX)
and use that variable in the subsequent query.

See section 6.4 in the manual on macro definitions.

Warren