Description
An OraParameter object represents a bind variable in a SQL statement or PL/SQL
block.
Remarks
OraParameter objects are created, accessed, and removed indirectly through the
OraParameters collection of an OraDatabase object. Each parameter has an
identifying name and an associated value. You can automatically bind a parameter to
SQL and PL/SQL statements of other objects (as noted in the objects’ descriptions), by using the parameter’s name as a placeholder in the SQL or PL/SQL statement. Such use of parameters
can simplify dynamic queries and increase program performance.
Parameters are bound to SQL statements and PL/SQL blocks before execution. In
the case of a SQL SELECT statement, binding occurs before dynaset creation.
The OraParameters collection is part of the OraDatabase object so that all
parameters are available to any SQL statement or PL/SQL block executed within the
database (via CreateDynaset or ExecuteSQL). Before a SQL statement or PL/SQL
block is executed an attempt is made to bind all parameters of the associated
OraDatabase object. The bindings that fail (because the parameter doesn't apply to
that particular SQL statement or PL/SQL block), are noted and no attempt is
made to rebind them if the SQL statement or PL/SQL block is re-executed but
doesn't change.
Since neither SQL statements nor PL/SQL blocks are parsed locally (all parsing
is done by Oracle), any unnecessary binding results in performance
degradation. To prevent unnecessary parameter binding, make use of the AutoBindDisable and
AutoBindEnable methods.
By default, the maximum size of the ORAPARM_OUTPUT variable for ServerType
CHAR and VARCHAR2 is set to 127 bytes. Use the MinimumSize property to change this value. The minimum size of an ORAPARM_OUTPUT variable
for CHAR and VARCHAR2 must always be greater than the size of the expected
data from the database column.