Progress
Application Development
Environment — Getting Started


Defining the Query

The function of a SDO is to query a database and make the data available to other SmartObjects. These SmartObjects can include SDBs, SDVs, and other SDOs. In this part of the exercise, you are going to select a table and fields from the Sports2000 database for the query.

Follow these steps to define a query:

  1. In Page 1 of the SmartDataObject Wizard, choose Next to open Page 2:
  2. Choose Define Query to open the Query Builder window:
  3. Select Customer from the Available Tables list and choose Add.
  4. The Customer table now appears in the Selected Tables & Joins selection list, and the 4GL code for the query appears in the Query section.

  5. Choose OK to open Page 2 of the SmartDataObject Wizard:
  6. The 4GL Query text box of Page 2 now displays the 4GL code generated by the Query Builder, and the Define Query button label changes to Modify Query. You can use this button to change your query before exiting the SmartDataObject Wizard.

  7. In Page 2 of the SmartDataObject Wizard, choose Next to open Page 3:
  8. Page 3 is used to define the fields available to visualization objects, such as SDBs and SDVs.

  9. Choose Add fields to open the Column Editor dialog box:
  10. Choose Add to open the Multi-Field Selector dialog box to add fields from the Customer table:
  11. Select the first field (Address), hold down the SHIFT key, and click on the last field (Terms).
  12. With all of the fields selected, choose Add to move the fields to the Selected Fields selection list. Then choose OK.
  13. The Column Editor dialog box opens again and the selected fields appear in the Fields in SmartDataObject selection list. The letter “u” now appears before each field name to indicate that the field is updateable:

    NOTE: Usually, fields that define the unique key, in this instance CustNum, do not need to be updated.

  14. Choose OK in the Column Editor dialog box to open Page 3 of the SmartDataObject Wizard again.
  15. The selected fields now appear in the Fields Available to Visualization Objects selection list.

  16. Choose Next in Page 3 of the SmartDataObject Wizard to open Page 4. Page 4 notifies you that you have successfully created the SDO:

Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095