Now that you have an active connection to a database, you are ready to create a query. Before you start, create a visual part for your application as follows:
For the sample application, type SampleDatabaseView.
The new part is added to the list of parts for your database application and the Composition Editor opens on the part.
VisualAge supports three separate query parts:
This section explains how to use the Multi-row Query part. Refer to More database techniques for instructions for using the Single-Row Query and SQL Statement parts.
This creates an empty query part, which does not yet do anything. To make the query do something useful, you need to change its settings.
The Multi-row Query Settings window opens. You use this window to
define or choose a SELECT statement to run, to set the fetch policy for the
query, and to set the update policy for the result table.
For the sample application, select SampleConSpec.
![]() | You can check the status of a connection specification by selecting the Connection Specs... push button. This button displays the Database connection specifications window. If the value in the Active? field is Yes, then you are connected to the database manager. If the value in this field is No, then you can connect to the database manager by selecting the connection specification, pressing mouse button 2 (or 3) to display the pop-up menu, and then selecting Connect. |
For the sample application, select
SampleDatabaseAccessSet.
![]() | The connection aliases and access sets that appear in the drop-down lists on this window include those defined for the current application and its prerequisites. |
You will use the remaining pages of the settings notebook later. For now, the next step is using the SELECT Details window to define a SELECT statement for this query.