<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hello,</p>
<p>are there two single quote characters or one double quotes
character? Can you test if it works with double quotes instead of
single quotes?</p>
<p>Cheers,<br>
Daniel<br>
</p>
<br>
<div class="moz-cite-prefix">On 02/05/16 09:42, gmele wrote:<br>
</div>
<blockquote cite="mid:1462174956891-148005.post@n5.nabble.com"
type="cite">
<pre wrap="">Hello Daniel,
thx for your quick answer.
After having failed with db_oracle module, we effectively tried db_unixodbc.
But even with unixodbc, we got some strange errors when kamailio tries to do
queries including dates in the where clause:
Example of an error reported by kamailio:
May 2 08:30:14 newvm1 /usr/sbin/kamailio[26298]: ERROR: nathelper
[nathelper.c:2089]: nh_timer(): failed to fetch contacts
May 2 08:30:15 newvm1 /usr/sbin/kamailio[26298]: ERROR: db_unixodbc
[dbase.c:133]: db_unixodbc_submit_query(): rv=-1. Query= select
received,contact,socket,cflags,path,ruid from location *where
expires>''2016-05-02 06:30:15'' *AND partition=11 AND keepalive=1
May 2 08:30:15 newvm1 /usr/sbin/kamailio[26298]: ERROR: db_unixodbc
[connection.c:220]: db_unixodbc_extract_error():
unixodbc:SQLExecDirect=HY000:1:933:[Oracle][ODBC][Ora]ORA-00933: SQL command
not properly ended#012
May 2 08:30:15 newvm1 /usr/sbin/kamailio[26298]: ERROR: <core>
[db_query.c:132]: db_do_query_internal(): error while submitting query
As you can see, the date in the request seems has a double quote surrounding
it : where expires>''2016-05-02 06:30:15''. In fact it is 2 times the
character <'>.
If I execute the above request in the isql tool provided by unixODBC, it
also fails. If I remove the double quote around the date, it works:
select received,contact,socket,cflags,path,ruid from location *where
expires>'2016-05-02 06:30:15' *AND partition=11 AND keepalive=1;
Do you have an idea on how to correct this problem?
Thx
Regards
Giovanni
--
View this message in context: <a class="moz-txt-link-freetext" href="http://sip-router.1086192.n5.nabble.com/Kamailio-and-Oracle-database-tp147990p148005.html">http://sip-router.1086192.n5.nabble.com/Kamailio-and-Oracle-database-tp147990p148005.html</a>
Sent from the Users mailing list archive at Nabble.com.
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference, Berlin, May 18-20, 2016 - <a class="moz-txt-link-freetext" href="http://www.kamailioworld.com">http://www.kamailioworld.com</a></pre>
</body>
</html>