<div dir="ltr">Thank you for the response <span class="">Matthew. It makes perfect sense to cater to the majority of databases. The changes I did are custom to our setup so we can use Asterisk 12.4 with MS SQL Server 2012. I wanted to document this error so anyone else facing it could resolve it. Like we have backslash_is_escape setting in res_odbc.conf maybe we can provide a database_name setting and drive the query using this setting. </span><span class="">If I get time, I will submit a patch for review.</span><br>
<span class=""></span><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 11, 2014 at 8:01 AM, Matthew Jordan <span dir="ltr"><<a href="mailto:mjordan@digium.com" target="_blank">mjordan@digium.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="">On Sun, Aug 10, 2014 at 5:02 PM, Deepak Rawat<br>
<<a href="mailto:deepaksingh.rawat@gmail.com">deepaksingh.rawat@gmail.com</a>> wrote:<br>
><br>
><br>
><br>
> On Mon, Aug 11, 2014 at 3:29 AM, Deepak Rawat <<a href="mailto:deepaksingh.rawat@gmail.com">deepaksingh.rawat@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Hi,<br>
>><br>
>> I modified the query in res/res_config_odbc.c.<br>
>> Original: "SELECT MAX(LENGTH(var_val)) FROM %s WHERE filename='%s'"<br>
>> Modified: "SELECT MAX(LEN(var_val)) FROM %s WHERE filename='%s'"<br>
>><br>
>> I rebuilt the code and installed Asterisk again. Now static realtime is<br>
>> working. Should I file a bug report?<br>
>><br>
<br>
</div>You're more than welcome to; at the same time, the number of people<br>
using MS SQL Server with Asterisk is not tremendously high - at least<br>
when compared with the alternatives. Unfortunately, this is one place<br>
where making things compatible is problematic: MySQL and PostgreSQL<br>
(which are far more likely to be used with Asterisk) along with Oracle<br>
use LENGTH, not LEN.<br>
<br>
Your solution, as it is currently, wouldn't be acceptable, as it would<br>
cause far more problems than it would solve. About the only way I<br>
could see solving this would be to make it configurable some place.<br>
<br>
Given the relatively few number of people who use MS SQL Server, I<br>
wouldn't expect this issue to receive a lot of attention without a<br>
patch.<br>
<span class=""><font color="#888888"><br>
--<br>
Matthew Jordan<br>
Digium, Inc. | Engineering Manager<br>
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA<br>
Check us out at: <a href="http://digium.com" target="_blank">http://digium.com</a> & <a href="http://asterisk.org" target="_blank">http://asterisk.org</a><br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</font></span></blockquote></div><br></div></div></div>