Oracle Objects for OLE
Release 9.0.1

Part Number A90173-01

Home

Book List

Contents

Master Index

Feedback

Parameter Bindings

OO4O provides a way of enabling and disabling Parameter object binding at the time it processes the SQL statement. This can be done through AutoBindDisable and AutoBindEnable methods of the OraParameter object. If the SQL statement does not contain the parameter name, it is better to disable the OraParameter because it avoids an unnecessary reference of the parameter object. This is especially effective when the application is written primarily using PL/SQL procedures. For example:

Set OraDatabase = OraSession. OpenDatabase("ExampleDb",

"scott/tiger", 0&)

'Add the job input parameter with initial value MANAGER.

OraDatabase.Parameters.Add "job", "MANAGER", 1

'Add the deptno input parameter with initial value 10.

OraDatabase.Parameters.Add "deptno", 10, 1

'Add the job input parameter with initial value MANAGER.

OraDatabase.Parameters.Add "EmpCur", 0, 1

OraDatabase.Parameters("Empcur").ServerType = ORATYPE_CURSOR

'Disable the job parameter for now.

OraDatabase.Parameters("job").AutoBindDisable

set OraSqlStmt = CreateSQL("Begin GetEmpData(:Empcur, :deptno)

End;",0&)

Note how the "job" parameter object is not referenced while processing PL/SQL statement.


 
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.

Home

Book List

Contents