Re: How to change VB code to use bind variables?
Check on the MS support site. There are several articles detailing how to do this. Jared Miller, Jay [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 07/16/2002 02:08 PM Please respond to ORACLE-L To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] cc: Subject:How to change VB code to use bind variables? Hi, In checking my v$SQLArea I recently discovered that there was an often executed SQL statement that was not using bind variables. I tracked it down to a VB front end and asked the development group to modify the code. They asked me how to do it. Not being a VB programmer I said I had no idea but would try to find out. Here's an abbreviated version of the code. It's the sAcctId that seems to be causing the multiple executions. Anyone know how this can be rewritten to use bind variables? Can it be done from VB or do we need to transfer the code to PL/SQL on the back end? Private Function GetSQL(ByVal sKey As String, _ ByVal sAcctId As String, _ Optional ByVal sAcctNum As String, _ Optional ByVal sWhereAnd As String) Dim sConnect As String Dim sSql As String Dim oWsiLibData As WSILib.CDisplayData Dim rsCustomer As ADODB.Recordset Dim lCustId As Long Dim sCustId As String Select Case sKey ... ... Case accountinfo: sSql = SELECT a.id, a.account_no, a.type, a.title1, a.title2, a.title3, _ a.inventory_date date_opened, a.last_modified_date last_change, _ rc.description rebatecmsn, _ sSql = sSql account_info.fetch_email( sAcctId ) email sSql = sSql FROM account a, status s, usa_wh_tax u, fund f, _ stock_commission_codes sc, cmsn_rebate_codes rc, account_kind ak sSql = sSql , dual sSql = sSql WHERE a.status_id=s.id and a.usa_tax_code=u.code(+) _ and a.fund_id=f.id and _ a.s_stk_cmsn_code=sc.code(+) and a.cmsn_reb_code=rc.code(+) and a.kind_id=ak.id _ and a.id = sAcctId sConnect = sConnectWSI GetSQL = Array(sConnect, sSql) -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Miller, Jay INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: How to change VB code to use bind variables?
Hi Jared, Thanks for the suggestion. But I went to www.microsoft.com, clicked on support and searched on the words bind variables oracle visual basic After a dozen Internet Explorer Script errors I got a bunch of links with names like 26jbkjakjbmon That one led to a blank page. Others led to articles that didn't even mention bind variables. And I thought Metalink was bad. Does anyone have a link that goes directly to an article? Thanks, Jay Miller -Original Message- Sent: Tuesday, July 16, 2002 4:45 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Check on the MS support site. There are several articles detailing how to do this. Jared Miller, Jay [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 07/16/2002 02:08 PM Please respond to ORACLE-L To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] cc: Subject:How to change VB code to use bind variables? Hi, In checking my v$SQLArea I recently discovered that there was an often executed SQL statement that was not using bind variables. I tracked it down to a VB front end and asked the development group to modify the code. They asked me how to do it. Not being a VB programmer I said I had no idea but would try to find out. Here's an abbreviated version of the code. It's the sAcctId that seems to be causing the multiple executions. Anyone know how this can be rewritten to use bind variables? Can it be done from VB or do we need to transfer the code to PL/SQL on the back end? Private Function GetSQL(ByVal sKey As String, _ ByVal sAcctId As String, _ Optional ByVal sAcctNum As String, _ Optional ByVal sWhereAnd As String) Dim sConnect As String Dim sSql As String Dim oWsiLibData As WSILib.CDisplayData Dim rsCustomer As ADODB.Recordset Dim lCustId As Long Dim sCustId As String Select Case sKey ... ... Case accountinfo: sSql = SELECT a.id, a.account_no, a.type, a.title1, a.title2, a.title3, _ a.inventory_date date_opened, a.last_modified_date last_change, _ rc.description rebatecmsn, _ sSql = sSql account_info.fetch_email( sAcctId ) email sSql = sSql FROM account a, status s, usa_wh_tax u, fund f, _ stock_commission_codes sc, cmsn_rebate_codes rc, account_kind ak sSql = sSql , dual sSql = sSql WHERE a.status_id=s.id and a.usa_tax_code=u.code(+) _ and a.fund_id=f.id and _ a.s_stk_cmsn_code=sc.code(+) and a.cmsn_reb_code=rc.code(+) and a.kind_id=ak.id _ and a.id = sAcctId sConnect = sConnectWSI GetSQL = Array(sConnect, sSql) -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Miller, Jay INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Miller, Jay INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: How to change VB code to use bind variables?
did you try google? http://www.google.com/search?hl=enie=UTF-8oe=UTF-8q=bind+variables+oracle+visual+basicbtnG=Google+Search [EMAIL PROTECTED] 07/16/02 06:08PM Hi Jared, Thanks for the suggestion. But I went to www.microsoft.com, clicked on support and searched on the words bind variables oracle visual basic After a dozen Internet Explorer Script errors I got a bunch of links with names like 26jbkjakjbmon That one led to a blank page. Others led to articles that didn't even mention bind variables. And I thought Metalink was bad. Does anyone have a link that goes directly to an article? Thanks, Jay Miller -Original Message- Sent: Tuesday, July 16, 2002 4:45 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Check on the MS support site. There are several articles detailing how to do this. Jared Miller, Jay [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 07/16/2002 02:08 PM Please respond to ORACLE-L To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] cc: Subject:How to change VB code to use bind variables? Hi, In checking my v$SQLArea I recently discovered that there was an often executed SQL statement that was not using bind variables. I tracked it down to a VB front end and asked the development group to modify the code. They asked me how to do it. Not being a VB programmer I said I had no idea but would try to find out. Here's an abbreviated version of the code. It's the sAcctId that seems to be causing the multiple executions. Anyone know how this can be rewritten to use bind variables? Can it be done from VB or do we need to transfer the code to PL/SQL on the back end? Private Function GetSQL(ByVal sKey As String, _ ByVal sAcctId As String, _ Optional ByVal sAcctNum As String, _ Optional ByVal sWhereAnd As String) Dim sConnect As String Dim sSql As String Dim oWsiLibData As WSILib.CDisplayData Dim rsCustomer As ADODB.Recordset Dim lCustId As Long Dim sCustId As String Select Case sKey ... ... Case accountinfo: sSql = SELECT a.id, a.account_no, a.type, a.title1, a.title2, a.title3, _ a.inventory_date date_opened, a.last_modified_date last_change, _ rc.description rebatecmsn, _ sSql = sSql account_info.fetch_email( sAcctId ) email sSql = sSql FROM account a, status s, usa_wh_tax u, fund f, _ stock_commission_codes sc, cmsn_rebate_codes rc, account_kind ak sSql = sSql , dual sSql = sSql WHERE a.status_id=s.id and a.usa_tax_code=u.code(+) _ and a.fund_id=f.id and _ a.s_stk_cmsn_code=sc.code(+) and a.cmsn_reb_code=rc.code(+) and a.kind_id=ak.id _ and a.id = sAcctId sConnect = sConnectWSI GetSQL = Array(sConnect, sSql) -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Miller, Jay INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Miller, Jay INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Gene Sais INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).