Creating a query

Use the Query window to create a query.

About this task

To create a query:

Procedure

  1. Choose Components > Query from the HPL main window.

    The Query window appears, as The Query window shows.

  2. Click Create in the Selection Type group.
  3. Choose a name for your query and type it in the Query text box.
  4. In the Database text box, type the name of the database that contains the tables from which you want to extract data. Or, click the down arrow to select from a database selection list.
    The following figure shows the Query window with the Query text box completed and stores_demo selected from the selection list.
    Figure 1: The Query window

    begin figure description - This figure is described in the surrounding text. - end figure description
  5. Click OK.

    The Query-Definition window appears, as The Query-Definition window shows. The name that you chose for your query appears in the title bar.

  6. Type your query in the Select, From, and Where text boxes.
    The following figure shows the following simple query of the customer table of the stores_demo database:
    SELECT customer.fname, customer.lname, 
    customer.zipcode
    FROM customer
    WHERE zipcode > 50000
    Figure 2: The Query-Definition window

    begin figure description - This figure is described in the surrounding text. - end figure description

    If you prefer, you can type the entire query into the Select text box. If you later edit the query, ipload divides the query into SELECT, FROM, and WHERE clauses.

  7. Click OK to save the query and return to the Query window.

    The query that you just created now appears in the Query list box at the right side of the Query window.

  8. Click Cancel to return to the HPL main window.