INFORMIX Visionary Tutorial

List of Tasks

Tutorial Task #9

Creating a Parameterized Query

In this task, you use the Query wizard to guide you in creating a parameterized query. You join tables and filter output to create a more advanced query than in tutorial task #3.

In the World Manager, right-click World1 and select Insert Data Source.

In the New Data Source dialog box, select Advanced Query Wizard. Click OK.

.

In the Advanced Query wizard, do the following actions:

    1. From the Table/view list box, select the Orders table. Select and click > for each of the following columns: order_num, order_date, and backlog. Click Next.

Tip

    Double-clicking the column name also selects it.

    2. Choose Yes, there is more information. Click Next.

    3. From the Table/view list box, select the Items table. Select and click > for each of the following columns: order_num, total_price, and manu_code. Click Next.

    4. Click the Column button and choose items.order_num. Click OK.

    5. Click the Check button . Click the cell under Related field that is to the right of the equals sign (=) and is in the same row as items.order_num. Click the Column button, choose orders.order_num, click OK and click the Check button. Click Next.

    6. Choose No, there is no more information to be added. Click Next.

    7. Choose Yes, filter the rows based on additional criteria. Click Next.

    8. Click Define Parameter.

    9. In the Query Parameters dialog box, enter Dmanu_code in the Parameter name text box. Leave lvarchar for the data type. Check Has default value: and enter ANZ in the text box. Click OK.

    10. Click the Column button and select items.manu_code. Click OK. Enter items.manu_code = Dmanu_code in the text box. Click Next.

    11. Choose Return individual records. Click Next.

    12. In the What do you want to name the query? text box, enter OrdersByDate. Click Finish.

Click Yes to view the data sheet. The data sheet should look similar to the following:


Copyright © 1998, Informix Software, Inc. All rights reserved.