Using bind variables with Oracle and VB

Could someone please provide examples of how to submit select, update, and insert SQL to an Oracle database using bind variables?   (All my Google inquiries keep leading me to VB.NET code.)  

Since this is an select/update that takes place every five minutes against a huge table, bind variables are essential.  And I have a feeling the ADO method I used wasn't the best.

It would also be great if the examples included some error checking.

Thanks in advance for your kind response.
codefingerAsked:
Who is Participating?
 
junglerover77Commented:
Using ADO you can create a Command Object. Basically it's a temporary store query on the clietn side, that allows parameters. Please try the following code:

Private cmMyQry as ADODB.Command

    Set cmMyQry = New ADODB.Command
    Set cmMyQry.ActiveConnection = cnMyDB

    With cmMyQry
        .CommandText = "SELECT * FROM TABLE WHERE Field = ?"
        .Parameters.Append .CreateParameter(...)
        .Execute
    End With

Regards,
Jungle
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.