Oracle® Objects for OLE Developer's Guide 10g Release 1 (10.1) Part Number B10118-01 |
|
See Also |
Quick Tour |
Batch Insert Form |
After defining the parameter arrays, we populate them with grid column elements using the Put_Value method.
To commit the parameter array elements to the database, this procedure uses the CreateSQL() method with a SQL INSERT statement containing the parameter arrays. Since the CreateSQL() method executes the SQL INSERT statement in addition to creating a SQL statement object, all column elements (parameter array elements) are inserted into the EMP table with this one statement.
When an error occurs executing a SQL INSERT statement containing parameter arrays, the SQL statement object is still created with no explicitly raised error. To identify such errors, we always check the OraDatabase.LastServerErr and OraDatabase.LastServerErrText properties immediately after executing CreateSQL.
The CreateSQL method updates the database directly and has no effect on the dynaset EmpDynaset. We must refresh this dynaset to reflect the newly inserted records by executing DbRefresh.
The CommitGrid_Click() event procedure does the following: