humm, i am not very sure what is the problem then. Can you try below and reply me with result?

1. Enable SQL query log on db server side, and see what SQL FS sends to the server? An ODBC trace file may also help.

2. Why are you defining both column name and custom SQLs? Typically you use only one of them, not both at the same time, so comment out one of them and test.

3. The custom SQL you are using has back-quotes, though these are permitted by ANSI SQL, but may create problem for other languages, i.e. the SQL you specify is in an XML file, which is interpreted by C++, which is then send to ODBC and then send to actual db server. Any of these interfaces may misinterpret them (Step 1 will give you clear clue on this).

Thank you.


On Tue, Mar 5, 2013 at 5:11 PM, Shahzad Bhatti <shahzad.bhatti@g-r-v.com> wrote:
thanks Mr. Muhammad Shahzad for the reply but issue is that when i use to access database on console there it works fine but when i use in dialplan here it not works

here is my console output
[root@localhost includes]# isql -v freeswitch
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> use test;
SQLRowCount returns 0
SQL> select * from tb_accounts;
+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+
| id        | name                                                                                                                                                                                                                                                           | cash                    |
+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+
| 1         | shahzad                                                                                                                                                                                                                                                        | 10                      |
| 2         | saeed                                                                                                                                                                                                                                                          | 50                      |
| 3         | usman                                                                                                                                                                                                                                                          | 10                      |
+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+
SQLRowCount returns 3
3 rows fetched
SQL> update tb_accounts set cash = cash -1 where id =1;
SQLRowCount returns 1
SQL> select * from tb_accounts;
+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+
| id        | name                                                                                                                                                                                                                                                           | cash                    |
+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+
| 1         | shahzad                                                                                                                                                                                                                                                        | 9                       |
| 2         | saeed                                                                                                                                                                                                                                                          | 50                      |
| 3         | usman                                                                                                                                                                                                                                                          | 10                      |
+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+
SQLRowCount returns 3
3 rows fetched
here u can see that update is also working, and here is my dialplan xml
        <document type="freeswitch/xml">
               <section name="dialplan" description="RE Dial Plan For FreeSwitch">
                     <context name="public">
                          <extension name="checkBalance">
                                <condition field="destination_number" expression="^126$">
                                     <action application="set" data="nibble_rate=0.03"/>
                                     <action application="set" data="nibble_account=1"/>
                                     <action application="answer"/>
                                     <action application="hangup"/>
                                </condition>
                          </extension>
                     </context>
               </section>
        </document>

i also check that the user and password and database is also correct.

any help is appreciated

Regards

Shahzad Bhatti

---------- Forwarded message ----------
From: Muhammad Shahzad <shaheryarkh@gmail.com>
To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org>
Cc: 
Date: Fri, 1 Mar 2013 17:07:39 +0100
Subject: Re: [Freeswitch-users] Error! Failed to log to database using nibblebill
Problem is with SELECT query, most likely db connection parameters are missing/invalid OR the db user configured does not have enough permissions to execute SELECT,

2013-03-01 22:29:52.293493 [ERR] mod_nibblebill.c:380 Error running this query: [SELECT `cash` AS nibble_balance FROM `tb_accounts` WHERE `id`=1]

Login db server from FS machine with same db user as configured in FS configs and run above query, it would give you hint on what is actually wrong.

Thank you.


On Fri, Mar 1, 2013 at 1:42 PM, Shahzad Bhatti <shahzad.bhatti@g-r-v.com> wrote:
hi
i am using a nibblebill  the call cost but have some problem in it. my nibblebill.conf.xml file is as

and console log is 


i got Error Failed to log to database! Doing update query 

reply me about the issue 

Regards

Shahzad Bhatti

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org




--
Muhammad Shahzad
-----------------------------------
CISCO Rich Media Communication Specialist (CRMCS)
CISCO Certified Network Associate (CCNA)
Cell: +49 176 99 83 10 85
MSN: shari_786pk@hotmail.com
Email: shaheryarkh@googlemail.com