Hello,
sql_xquery() does not store anything inside $dbr(...), it stores the result inside $xavp(...).
You have to use sql_query() to store inside $dbr().
Cheers, Daniel
On 05.11.21 15:55, Benoît Panizzon wrote:
Dear List...
kamcmd> version kamailio 5.4.7 (x86_64/linux)
Strange issue found.
According to: https://kamailio.org/docs/modules/5.4.x/modules/sqlops.html
I should get return value 2 if no rows returned:
$var(query) contains a query that does not match (number is not assigned)
if (sql_xquery("impkam", "$var(query)", "assignedtn") == 1) { if ($avp(debug) > 1) { xlog("L_INFO", "$cfg(route): SQL Dump Result: $var(assignedtn) ROWS: $dbr(assignedtn=>rows) \n"); } do stuff with the assigned number
} else { do stuff in case that number is not assigned }
Log Output:
CHECK_ASSIGNED_TN: SQL Dump Result: 0 ROWS: 0
So the return value of the query was == 1 but the result contains no rows. How can that be?
-- Mit freundlichen Grüssen
-Benoît Panizzon- @ HomeOffice und normal erreichbar
I m p r o W a r e A G - Leiter Commerce Kunden ______________________________________________________
Zurlindenstrasse 29 Tel +41 61 826 93 00 CH-4133 Pratteln Fax +41 61 826 93 01 Schweiz Web http://www.imp.ch ______________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
- sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe: