Oracle Objects for OLE C++ Class Library Release 9.2 Part Number A95896-01 |
|
Applies To
Description
This method executes the current SQL statement, which is set by the Open method and reset by the SetSQL method.
Usage
oresult Refresh(void)
Remarks
Using osqlstmt.Refresh is the preferred refresh method when changing parameter values, because the required database operations are minimized (SQL parsing, binding, etc.). This refresh method can lead to much improved performance when only parameter values have changed.
Return Value
An oresult indicating whether the operation succeeded (OSUCCESS) or not (OFAILURE).
Example
// open an ODatabase
ODatabase odb("ExampleDB", "scott", "tiger");
// get the parameter collection
OParameterCollection pcoll = odb.GetParameters();
OParameter p1 = pcoll.Add("EMPNO", 7369, OPARAMETER_INVAR, OTYPE_NUMBER);
OParameter p2 = pcoll.Add("ENAME", "me", OPARAMETER_OUTVAR, OTYPE_VARCHAR2);
// now set up a dynaset that uses that parameter
OSqlStmt osqlstmt(odb, "Begin Employee.GetEmpName (:EMPNO, :ENAME); end;");
// Should display SMITH
MessageBox(p2.GetVlaue());
// set EMPNO parameter value to 7499
p1.SetValue(7499);
// and refresh the dynaset to get the new records
osqlstmt.Refresh();
// Should display ALLEN
MessageBox(p2.GetVlaue());
|
Copyright © 1998, 2002 Oracle Corporation. All Rights Reserved. |
|