Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Error: 'LENGTH' is not a recognized built-in function name


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
deepaksingh.rawat at g...
Guest





PostPosted: Sun Aug 10, 2014 5:03 pm    Post subject: [asterisk-users] Error: 'LENGTH' is not a recognized built-i Reply with quote

On Mon, Aug 11, 2014 at 3:29 AM, Deepak Rawat <deepaksingh.rawat@gmail.com (deepaksingh.rawat@gmail.com)> wrote:
Quote:
Hi,


I modified the query in res/res_config_odbc.c.
Original:  "SELECT MAX(LENGTH(var_val)) FROM %s WHERE filename='%s'"

Modified: "SELECT MAX(LEN(var_val)) FROM %s WHERE filename='%s'"


I rebuilt the code and installed Asterisk again. Now static realtime is working. Should I file a bug report?



On Mon, Aug 11, 2014 at 2:37 AM, Deepak Rawat <deepaksingh.rawat@gmail.com (deepaksingh.rawat@gmail.com)> wrote:
Quote:
Hi,

I am using Asterisk 12.4 static realtime. I am storing agents.conf related data in MS SQL Server 2012 database. But I keep getting 'LENGTH' is not a recognized built-in function name error message. I debugged and found that it's due to the changes done in this ticket: https://issues.asterisk.org/jira/browse/ASTERISK-23582. As there is no LENGTH function in MS SQL Server, therefore, I am getting this error. Is this error due to some config issue at my end?


Thank you,

Deepak







Back to top
mjordan at digium.com
Guest





PostPosted: Sun Aug 10, 2014 9:32 pm    Post subject: [asterisk-users] Error: 'LENGTH' is not a recognized built-i Reply with quote

On Sun, Aug 10, 2014 at 5:02 PM, Deepak Rawat
<deepaksingh.rawat@gmail.com> wrote:
Quote:



On Mon, Aug 11, 2014 at 3:29 AM, Deepak Rawat <deepaksingh.rawat@gmail.com>
wrote:
Quote:

Hi,

I modified the query in res/res_config_odbc.c.
Original: "SELECT MAX(LENGTH(var_val)) FROM %s WHERE filename='%s'"
Modified: "SELECT MAX(LEN(var_val)) FROM %s WHERE filename='%s'"

I rebuilt the code and installed Asterisk again. Now static realtime is
working. Should I file a bug report?


You're more than welcome to; at the same time, the number of people
using MS SQL Server with Asterisk is not tremendously high - at least
when compared with the alternatives. Unfortunately, this is one place
where making things compatible is problematic: MySQL and PostgreSQL
(which are far more likely to be used with Asterisk) along with Oracle
use LENGTH, not LEN.

Your solution, as it is currently, wouldn't be acceptable, as it would
cause far more problems than it would solve. About the only way I
could see solving this would be to make it configurable some place.

Given the relatively few number of people who use MS SQL Server, I
wouldn't expect this issue to receive a lot of attention without a
patch.

--
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
deepaksingh.rawat at g...
Guest





PostPosted: Sun Aug 10, 2014 11:21 pm    Post subject: [asterisk-users] Error: 'LENGTH' is not a recognized built-i Reply with quote

Thank you for the response 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. If I get time, I will submit a patch for review.

On Mon, Aug 11, 2014 at 8:01 AM, Matthew Jordan <mjordan@digium.com (mjordan@digium.com)> wrote:
Quote:
On Sun, Aug 10, 2014 at 5:02 PM, Deepak Rawat
<deepaksingh.rawat@gmail.com (deepaksingh.rawat@gmail.com)> wrote:
Quote:



On Mon, Aug 11, 2014 at 3:29 AM, Deepak Rawat <deepaksingh.rawat@gmail.com (deepaksingh.rawat@gmail.com)>
wrote:
Quote:

Hi,

I modified the query in res/res_config_odbc.c.
Original:  "SELECT MAX(LENGTH(var_val)) FROM %s WHERE filename='%s'"
Modified: "SELECT MAX(LEN(var_val)) FROM %s WHERE filename='%s'"

I rebuilt the code and installed Asterisk again. Now static realtime is
working. Should I file a bug report?



You're more than welcome to; at the same time, the number of people
using MS SQL Server with Asterisk is not tremendously high - at least
when compared with the alternatives. Unfortunately, this is one place
where making things compatible is problematic: MySQL and PostgreSQL
(which are far more likely to be used with Asterisk) along with Oracle
use LENGTH, not LEN.

Your solution, as it is currently, wouldn't be acceptable, as it would
cause far more problems than it would solve. About the only way I
could see solving this would be to make it configurable some place.

Given the relatively few number of people who use MS SQL Server, I
wouldn't expect this issue to receive a lot of attention without a
patch.

--
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
b.lavallee at globalta...
Guest





PostPosted: Mon Aug 11, 2014 12:15 am    Post subject: [asterisk-users] Error: 'LENGTH' is not a recognized built-i Reply with quote

On 8/11/14, 11:31, Matthew Jordan wrote:
Quote:
On Sun, Aug 10, 2014 at 5:02 PM, Deepak Rawat
<deepaksingh.rawat@gmail.com> wrote:
Quote:


On Mon, Aug 11, 2014 at 3:29 AM, Deepak Rawat <deepaksingh.rawat@gmail.com>
wrote:
Quote:
Hi,

I modified the query in res/res_config_odbc.c.
Original: "SELECT MAX(LENGTH(var_val)) FROM %s WHERE filename='%s'"
Modified: "SELECT MAX(LEN(var_val)) FROM %s WHERE filename='%s'"

I rebuilt the code and installed Asterisk again. Now static realtime is
working. Should I file a bug report?

You're more than welcome to; at the same time, the number of people
using MS SQL Server with Asterisk is not tremendously high - at least
when compared with the alternatives. Unfortunately, this is one place
where making things compatible is problematic: MySQL and PostgreSQL
(which are far more likely to be used with Asterisk) along with Oracle
use LENGTH, not LEN.

Another option, just add LENGTH as a user-defined function to MS SQL.

||-- Something like this...|
CREATE FUNCTION LENGTH (@input)
||BEGIN
RETURN ( LEN(@input) )
END|


Quote:

Your solution, as it is currently, wouldn't be acceptable, as it would
cause far more problems than it would solve. About the only way I
could see solving this would be to make it configurable some place.

Given the relatively few number of people who use MS SQL Server, I
wouldn't expect this issue to receive a lot of attention without a
patch.





--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
deepaksingh.rawat at g...
Guest





PostPosted: Mon Aug 11, 2014 12:20 am    Post subject: [asterisk-users] Error: 'LENGTH' is not a recognized built-i Reply with quote

I tried that but for some reason couldn't get it working. My custom function was getting created in dbo and the asterisk kept throwing error. Maybe some mistake on my part. I will try it again.


On Mon, Aug 11, 2014 at 10:44 AM, Brian LaVallee <b.lavallee@globaltank.jp (b.lavallee@globaltank.jp)> wrote:
Quote:

On 8/11/14, 11:31, Matthew Jordan wrote:
Quote:
On Sun, Aug 10, 2014 at 5:02 PM, Deepak Rawat
<deepaksingh.rawat@gmail.com (deepaksingh.rawat@gmail.com)> wrote:
Quote:


On Mon, Aug 11, 2014 at 3:29 AM, Deepak Rawat <deepaksingh.rawat@gmail.com (deepaksingh.rawat@gmail.com)>
wrote:
Quote:
Hi,

I modified the query in res/res_config_odbc.c.
Original:  "SELECT MAX(LENGTH(var_val)) FROM %s WHERE filename='%s'"
Modified: "SELECT MAX(LEN(var_val)) FROM %s WHERE filename='%s'"

I rebuilt the code and installed Asterisk again. Now static realtime is
working. Should I file a bug report?

You're more than welcome to; at the same time, the number of people
using MS SQL Server with Asterisk is not tremendously high - at least
when compared with the alternatives. Unfortunately, this is one place
where making things compatible is problematic: MySQL and PostgreSQL
(which are far more likely to be used with Asterisk) along with Oracle
use LENGTH, not LEN.


Another option, just add LENGTH as a user-defined function to MS SQL.

||-- Something like this...|
CREATE FUNCTION LENGTH (@input)
||BEGIN
   RETURN ( LEN(@input) )
END|


Quote:

Your solution, as it is currently, wouldn't be acceptable, as it would
cause far more problems than it would solve. About the only way I
could see solving this would be to make it configurable some place.

Given the relatively few number of people who use MS SQL Server, I
wouldn't expect this issue to receive a lot of attention without a
patch.





--

_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
              http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services