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 Build a Frame DynamicallyIf your script includes statements that access the database, such as select orupdate, you can use a select statement to retrieve the necessary columnnames for the target lists of the statements and a select loop to build at leastpart of the database statements.Alternatively, you can use a query object to create the target fields andprovide the user with the ability to change the data in the database. For anexample of using a query object to perform these operations, see CreatingDynamic Frames (see page 363).The DynamicFrame frame uses a select loop to obtain information and buildthe target fields and a cursor object to allow the user to make changes to datain the database. For details about the implementation in the DynamicFrameframe, see How You Can Construct the Fields (see page 405) and How You CanComplete the SQL Statements (see page 411).How You Can Attach the Frame to the ApplicationAfter you have completed all of the frame elements and attached them to theframe, you must attach the frame itself to the application by setting theParentApplication attribute of the new frame's FrameSource object. The valueto which you set this attribute must be the same value that is in theParentApplication attribute of the currently executing frame. (The currentlyexecuting frame is a frame of your dynamic application.)To access the ParentApplication attribute of a currently active frame, use theObjectSource attribute of the frame's FrameExec object. Whenever you call oropen a frame, OpenROAD creates a FrameExec object for that instance ofopening or calling. The FrameExec object gives you information about thecurrent state of a running frame. The ObjectSource attribute points to theframe's FrameSource object. The ParentApplication attribute is defined for theFrameSource object.For example, the DynamicFrame frame attaches the generated test_frameframe to the currently executing frame (the starting frame) by assigning thevalue of the ParentApplication attribute of the current frame's FrameSourceobject to the corresponding attribute of the generated frame's FrameSourceobject:test_frame.ParentApplication =CurFrame.ObjectSource.ParentApplication;For an example of attaching a frame to an application, see How You Can Addthe Frame to the Application (see page 416).396 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!