Re: [exim] handling nulls in SQL lookups

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Magnus Holmgren
Datum:  
To: exim-users
Betreff: Re: [exim] handling nulls in SQL lookups
On Sunday 23 July 2006 11:03, Jakob Hirsch took the opportunity to write:
> Quoting Ian P. Christian:
> >           set acl_m3  = ${lookup sqlite {SQLITE_DB SPAM_COUNT}{$value}}
> > However, this will obviously return nothing if the host has never mailed
> > before, and the 'Spam total' reports as NULL.

>
> set acl_m3 = ${lookup sqlite {SQLITE_DB SPAM_COUNT}{$value}{0}}
>
> Will return 0 if the lookup returns nothing.


If the lookup returns no records, that is. This lookup returns one record with
one column with a NULL value.

-- 
Magnus Holmgren        holmgren@???
                       (No Cc of list mail needed, thanks)