[asterisk-bugs] [Asterisk 0010722]: [patch] Allow odbc queries using SQLExecDirect() (ie. non prepared statement execution)

noreply at bugs.digium.com noreply at bugs.digium.com
Fri Sep 14 11:39:17 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10722 
====================================================================== 
Reported By:                mnicholson
Assigned To:                Corydon76
====================================================================== 
Project:                    Asterisk
Issue ID:                   10722
Category:                   Resources/res_odbc
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     assigned
Asterisk Version:            SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 82391 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             09-14-2007 11:15 CDT
Last Modified:              09-14-2007 11:39 CDT
====================================================================== 
Summary:                    [patch] Allow odbc queries using SQLExecDirect()
(ie. non prepared statement execution)
Description: 
This patch adds a hook into res_odbc to allow non prepared statement
execution.  The idea behind prepared statements (SQLPrepare() ->
SQLExecute()) in ODBC is to allow efficient execution of a single statement
multiple times.  I do not think there is a single place in asterisk where
we execute the same query over and over again in this manner.  Generally we
prepare a query execute it, then free the statement handle.

This patch provides a hook to execute a query with in the res_odbc
framework (handling db reconnection and such) but use SQLExecDirect() which
does not require SQLPrepare().  On MS SQL databases this can dramatically
improve database performance.  Patches to use this function from func_odbc
and voicemail should follow from vovochka and myself.
====================================================================== 

---------------------------------------------------------------------- 
 mnicholson - 09-14-07 11:39  
---------------------------------------------------------------------- 
You are mistaken, you can bind parameters with SQLExecDirect().  I found
code that does this on the internet, and vovochka will submit a patch for
voicemail that does this as well. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
09-14-07 11:39  mnicholson     Note Added: 0070546                          
======================================================================




More information about the asterisk-bugs mailing list