diff options
Diffstat (limited to '')
-rw-r--r-- | src/odbc/odbc_queries.erl | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/odbc/odbc_queries.erl b/src/odbc/odbc_queries.erl index 3e3a2942..b614fd79 100644 --- a/src/odbc/odbc_queries.erl +++ b/src/odbc/odbc_queries.erl @@ -90,6 +90,8 @@ -define(generic, true). -endif. +-include("ejabberd.hrl"). + %% Almost a copy of string:join/2. %% We use this version because string:join/2 is relatively %% new function (introduced in R12B-0). @@ -882,8 +884,14 @@ count_records_where(LServer, Table, WhereClause) -> ["select count(*) from ", Table, " with (nolock) ", WhereClause]). get_roster_version(LServer, LUser) -> - ejabberd_odbc:sql_query(LServer, - ["select version from dbo.roster_version with (nolock) where username = '", LUser, "'"]). -set_roster_version(LUser, Version) -> - update_t("dbo.roster_version", ["username", "version"], [LUser, Version], ["username = '", LUser, "'"]). + ejabberd_odbc:sql_query( + LServer, + ["EXECUTE dbo.get_roster_version '", LUser, "'"]). + +set_roster_version(Username, Version) -> + %% This function doesn't know the vhost, so we hope it's the first one defined: + LServer = ?MYNAME, + ejabberd_odbc:sql_query( + LServer, + ["EXECUTE dbo.set_roster_version '", Username, "', '", Version, "'"]). -endif. |