[jdev] Re: help for jabberd2; select some data from database

Stephen Marquard scm at marquard.net
Thu Mar 24 09:17:20 CST 2005


yang yang wrote:
> Hi, 
>      I  have reviewed the source code for jabberd2 .  And  I  want  to  query  the  mysql  database by “like”, but it seems that the source code doesn’t support that .
>     For example , I want to build a sql command like this : 
>  Select  *  from private where `collection-owner` = `xxx` AND `ns`  like  `storage:xxx` ;
>     I  found that the string-parse function “_st_mysql_convert_filter( )” only parse the string like “ns = xxx” .So  who can tell me how to query the mysql by “like”.
>     And how can I deal with command like this:
>    Select  *  from private where `collection-owner` = `xxx` AND `ns`  like  `storage:xxx`  AND `xml` like `xxxx`;

This really belongs on the jabberd list
(http://mail.jabber.org/mailman/listinfo/jabberd/, or subscribe through
gmane).

'like' isn't an operator supported by the filter code, but it's also
SQL-specific (and probably different according to SQL version), so one
would need a mechanism to generalise this to other types of storage
(e.g. bdb).

What are you trying to do with the like operator ?

Regards
Stephen




More information about the JDev mailing list