Hello,

are there two single quote characters or one double quotes character?
Can you test if it works with double quotes instead of single quotes?

Cheers,
Daniel


On 02/05/16 09:42, gmele wrote:
> 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: 
> http://sip-router.1086192.n5.nabble.com/Kamailio-and-Oracle-database-tp147990p148005.html
> Sent from the Users mailing list archive at Nabble.com.
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, Berlin, May 18-20, 2016 - 
http://www.kamailioworld.com

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

Reply via email to