AW: How to change VB code to use bind variables?

2002-07-17 Thread Stefan Jahnke

Hi 

I did a search on MSDN for sql bind variable. Here is the result page:

http://search.microsoft.com/default.asp?qu=sql+bind+variableboolean=ALLnq=
NEWso=RECCNTp=1ig=01ig=02ig=03ig=04ig=05ig=06i=00i=01i=02i=03i=
04i=05i=06i=07i=08i=09i=10i=11i=12i=13i=14i=15i=16i=17i=18i=1
9i=20i=21i=22i=23i=24i=25i=26i=27i=28i=29i=30i=31i=32i=33i=34
i=35i=36i=37i=38i=39i=40i=41i=42i=43i=44i=45i=46i=47i=48i=49
i=50i=51siteid=us/dev

Looks like some articles might help.

Try also these ones

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/
mdobjparameter.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/
mdmscadoobjmod.asp


Stefan Jahnke
Consultant
BOV Aktiengesellschaft
Voice: +49 201 - 4513-298
Fax: +49 201 - 4513-149
mailto:[EMAIL PROTECTED]

visit our website: http://www.bov.de
subscribe to our newsletter: http://www.bov.de/presse/newsletter.asp

Behalten Sie den Ueberblick - mit dem neuen BasicOverView, unserer
Seminaruebersicht fuer das 2. Halbjahr 2002. Sie haben noch kein Exemplar?
Schreiben Sie eine E-Mail an mailto:[EMAIL PROTECTED] oder rufen Sie uns
an unter 0 18 03 / 73 64 62 73!

Wie Sie wissen, koennen ueber das Internet versandte E-Mails leicht unter
fremden Namen  erstellt oder manipuliert werden. Aus diesem Grunde bitten
wir um Verstaendnis dafuer, dass  wir zu Ihrem und unserem Schutz die
rechtliche Verbindlichkeit der vorstehenden Erklaerungen und Aeusserungen
ausschliessen.

As you are probably aware, e-mails sent via the Internet can easily be
copied or manipulated by third parties. For this reason we would ask for
your understanding that, for your own protection and ours, we must decline
all legal responsibility for the validity of the statements and comments
given above.


-Ursprüngliche Nachricht-
Von: Miller, Jay [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 17. Juli 2002 00:08
An: Multiple recipients of list ORACLE-L
Betreff: 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

How to change VB code to use bind variables?

2002-07-16 Thread Miller, Jay

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).



Re: How to change VB code to use bind variables?

2002-07-16 Thread Jared . Still

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?

2002-07-16 Thread Miller, Jay

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?

2002-07-16 Thread Gene Sais

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).