[Freeswitch-users] Getting Error ORA-923 in oracle query execution
Rupa Schomaker
rupa at rupa.com
Mon Jan 10 20:18:37 MSK 2011
Someone should raise it as a minor bug with Oracle. :( They are the
only modern db that I know of that requires a hack of "FROM dual" on
the SQL.
I suppose either a) switch_odbc can auto detect oracle (not easy, it
would have to carry state in the dbh I guess) or b) a setting (again,
probably on the dbh) that you can put in FS's config to tell FS not to
do the select 1.
Either one is... umm.. yuck. :(
On Mon, Jan 10, 2011 at 5:39 AM, Rajesh Bansal
<bansal.rajeshkr at gmail.com> wrote:
> Hi All,
> I have find reason of problem with UnixOdbc (with Oracle). When we are using
> freeswitch with ODBC support before executing a sql query it run a test
> query "Select 1" which works at MYSQL but didn't work at ORACLE. This change
> should be in switch_odbc.c file. Please someone raise it as a minor bug so
> that it can be fixed in next releases.
> Best Regards,
> Rajesh Bansal
>
>
> On Mon, Jan 10, 2011 at 1:39 PM, Rajesh Bansal <bansal.rajeshkr at gmail.com>
> wrote:
>>
>> Hi Steve,
>> I am using following sample code.
>> use("ODBC");
>> var dsn = "rajesh_dsn";
>> var db_user = "avc";
>> var db_pass = "avc";
>> var db = new ODBC(dsn, db_user, db_pass);
>> var sql = "select sysdate from dual";
>> console_log("info","\nbefore connect with DB\n");
>> if(db.connect())
>> {
>> if(session.ready())
>> session.answer();
>> console_log("info","\n\nafter connect with DB\n");
>> if (db.exec(sql))
>> session.hangup(); //might want to say something nice instead.
>> else
>> console_log("info","\n\nconnect with DB\n");
>> while (db.nextRow())
>> {
>> row = db.getData();
>> console_log("info", "UserName: " );
>> }}
>> else
>> console_log("info","\n\nunable to connect with DB\n");
>> Best Regards,
>> Rajesh Bansal
>>
>>
>>
>> On Fri, Jan 7, 2011 at 11:35 PM, Steven Ayre <steveayre at gmail.com> wrote:
>>>
>>> Sounds like a SQL syntax error - can you show us the code that's
>>> executing the statement that gives the error?
>>>
>>> Specifically Oracle is complaining about not finding FROM where it
>>> expects to in the SELECT.
>>>
>>> -Steve
>>>
>>>
>>> On 7 January 2011 15:15, Rajesh Bansal <bansal.rajeshkr at gmail.com> wrote:
>>> > Hi ,
>>> > I am getting error ORA -923 (from missing from statement) when i am
>>> > tring to
>>> > execute a sql query from Javascript file. Here i am successfully able
>>> > to
>>> > connect & execute queries with MYSQL. But in oracle connection i am
>>> > getting
>>> > this error even i can successfully make a connection with oracle. with
>>> > isql
>>> > & a program written in C i can connect and execute queries ok.
>>> > I am using
>>> > FreeSwitch 1.0.6
>>> > unixOdbc 2.3.0
>>> > Please tell me where is problem.
>>> > Best Regards,
>>> > Rajesh Bansal
>>> >
>>> >
>>> > _______________________________________________
>>> > FreeSWITCH-users mailing list
>>> > FreeSWITCH-users at lists.freeswitch.org
>>> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> >
>>> > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> > http://www.freeswitch.org
>>> >
>>> >
>>>
>>> _______________________________________________
>>> FreeSWITCH-users mailing list
>>> FreeSWITCH-users at lists.freeswitch.org
>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> http://www.freeswitch.org
>>
>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
--
-Rupa
More information about the FreeSWITCH-users
mailing list