10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

How You Can Access a Database with DataStream ObjectsHow You Can Update Data with a Query ObjectTo update underlying database tables whose columns have been specified forupdate and mapped to the Columns array attribute, use QueryObject'sDBUpdate method.This method takes the following parameters:RowNumberSpecifies the row of the cache updated by the operation (used only ifopened in QY_CACHE mode)Default: the current rowIsRepeatedSet to TRUE if repeat queries are to be usedDefault: FALSEZeroRowsIsErrorIf set to TRUE, a zero row result indicates an error; otherwise OK isreturnedDefault: FALSEMaxRowsIf nonzero, specifies the maximum number of rows that may be affectedby the query. If more rows are affected than is specified by MaxRows,returns an error.Default: zero (unlimited)How You Can Delete Data with a Query ObjectDeleting data with a query object is more complicated than updating it. Afterremoving the deleted row from the database, the code must check whetherany rows remain in the cached data set.For example, assume the data set originally contained four rows and the userjust deleted the third row. After the third row is deleted from the cache, thefourth row becomes the third row and CurRow becomes 3. You can display thisrow directly by invoking the Load method. Note that you do not want to invokethe NextRow method because the deletion from the cache automaticallyperforms that operation.Assume instead that the user deleted the fourth and last row in the cache. Inthis case, you do not want to invoke the Load method because there is nocurrent row. Instead, you want to make the current row point to an actual row.Working with a Database 181

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!