10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

How You Can Access a Database with Standard SQL StatementsOpenROAD also provides access to the database through the DataStreamsystem class without directly executing an SQL statement. DataStream'ssubclass, SQLSelect, provides greater power and flexibility than the primarydata manipulation statements. In particular, SQLSelect objects are useful for:• Letting users step backwards through the retrieved data or to movedirectly to a specific row• Creating dynamic queries when the target fields or variables are unknownuntil runtime• Changing queries at runtime (for example, modifying the where and orderby clauses)SQLSelect objects interact dynamically with the database, verifying that thenames and data types of the columns in their target list are the same as thosecoded when the application was developed.QueryObject objects, a subclass of the SQLSelect class, also supportpartitioning a query and enable update, insert, and delete operations ondynamically retrieved data.For a detailed discussion and an example of using an SQLSelect to retrievedata, see How You Can Access a Database with DataStream Objects (seepage 165). For a detailed discussion and an example of using a query object tochange data, see How You Can Use Query Objects (see page 177).How You Can Access a Database with Standard SQLStatementsIn addition to the four primary data manipulation statements (select, update,insert, and delete), OpenROAD lets most SQL statements to be used directly inyour 4GL scripts. For a list of these statements, see the Language Reference<strong>Guide</strong> online help.To use SQL statements that you cannot code directly in a 4GL script, such asthe statement for creating a database procedure, OpenROAD provides theexecute immediate statement. For more information about this statement, seeHow You Can Use the Execute Immediate Statement (see page 155).The following subsections describe how to use the select, update, insert, anddelete statements in your OpenROAD applications.148 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!