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 ObjectsThe following subsections explain using statically created SQLSelect objectsand QueryObject objects. For a discussion and example of using a queryobject, see How You Can Use Query Objects (see page 177).How You Can Select a Mode for a DataStream ObjectThe DataStream's Open method performs the actual data retrieval. One of itsarguments, the mode of operation, determines the query's behavior. Thevarious modes are:QY_CACHESpecifies that the retrieved data set is cached, allowing previousnavigation and random seek; requires the Load and NextRow methods todisplay data.QY_CURSORSpecifies that the retrieved data set uses a DBMS cursor, allowing nestedqueries; requires the Load and NextRow methods to display data.QY_DIRECTSpecifies that the retrieved data set is returned as in a select loop;precludes nested queries because a single select statement is in effectbetween the Open and Close of the DataStream object; requires the Loadand NextRow methods to display data.QY_ARRAYSpecifies that the retrieved data set is immediately loaded into thespecified array or table field by the Open method (making the Load andNextRow methods meaningless); requires the UpdField method to refreshthe display if loading into a table field.Using QY_ARRAY mode enhances performance if you are loading a table fieldbecause an entire array of data is loaded. However, to take advantage of theenhanced performance, the class of the array being loaded must have attributenames that match the names of the columns in the query (which can differfrom the names of columns in underlying database tables due to “as” clauses).How You Can Use SQLSelect ObjectsThe following text uses examples that might be included in a frame thatretrieves information from a customer table.166 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!