Defining the Data Using SQL Select

Use the SQL Select painter to define a SQL statement to retrieve data for the DataWindow object.

  1. In the New DataWindow wizard, click SQL Select in the Choose Data Source page and click Next.
    The Select Tables dialog box opens.
  2. Select the tables and views to use in the DataWindow object.
  3. Select the columns to be retrieved from the database.
  4. Join the tables if you have selected more than one.
    See Joining tables in the PowerBuilder Users Guide.
  5. Select retrieval arguments if appropriate.
    See Using retrieval arguments in the PowerBuilder Users Guide.
  6. Limit the retrieved rows with where, order by, group by, and having criteria, if appropriate.
    See Specifying selection, sorting, and grouping criteria in the PowerBuilder Users Guide.
  7. To eliminate duplicate rows, select Design > Distinct.
    The distinct keyword is added to the select statement.
  8. Click OK.
    You return to the wizard to complete the definition of the DataWindow object.