Cyrus SASL SQL options
Andreas Winkelmann
ml at awinkelmann.de
Fri Jun 30 06:51:35 EDT 2006
Am Friday 30 June 2006 08:43 schrieb Berger, Stefan (IT - Management):
> TOP-Post?
http://en.wikipedia.org/wiki/Top-posting
> So, when there are so many possibilities, can someone post one or two of
> them?
> >> sasl_sql_select: SELECT password FROM mailusers WHERE account = '%u@%r'
> >>
> >> table mailusers containd all valid email accountss but now i have
> >> 2,3,4,5 tables with email accounts. so can i make 2,3,4,5 sas_sql_select
> >> entries?
sql_select:
(SELECT password FROM mailusers1 WHERE account = '%u@%r')
UNION
(SELECT password FROM mailusers2 WHERE account = '%u@%r')
UNION
(SELECT password FROM mailusers3 WHERE account = '%u@%r')
For example. One Line behind sql_select of course.
> > Look for union or views or maybe stored procedures.
Or Create a View and query the View.
CREATE VIEW allmailusers AS
(SELECT account, password FROM mailusers1)
UNION
(SELECT account, password FROM mailusers2)
UNION
(SELECT account, password FROM mailusers3);
sql_select: SELECT password FROM allmailusers WHERE account = '%u@%r'
Availability depends on your MySQL-Version and on your Tables of course.
--
Andreas
More information about the Cyrus-sasl
mailing list