INFORMIX Visionary Tutorial

List of Tasks

Tutorial Task #3

Building a Data Source

You need to build a data source to specify the data you want to use in your world. You have several options to build a data source:

  • Use a wizard
  • Use a diagram
  • Use a SQL query

Suppose you have met with your DBA to discuss the ideas you have for your world as shown in your storyboard. Your DBA agrees to write a SQL query that you can use. Your DBA creates the SQL query based on the tables, columns, and filters in the stores7 database.

Note: In Tutorial Task #9, you use a wizard to build a data source.

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

In the New Data Source dialog box, select Direct SQL entry. Click OK.

Copy the following query and paste it in the Query Editor:

    SELECT R1.manu_code, R2.manu_name, R0.backlog,
         sum(R1.total_price) as total_price,
         sum(R1.quantity) as quantity
    FROM orders R0, items R1, manufact R2
    WHERE R0.order_num = R1.order_num
      and R1.manu_code = R2.manu_code
      and R0.backlog = :Dbacklog
    GROUP by R1.manu_code, R2.manu_name, R0.backlog
    ;
    

In the World Manager, click the Worlds tab.

Click the Data Sources button.

Click the plus sign next to Query1 to expand it.

Click the plus sign next to Parameters to expand it.

.

Double-click Dbacklog.

In the Query Parameter dialog box, select Ivarchar from the Data type list box and enter n in the Has default value text box. Click OK.

In the World Manager, right-click Query1 and select Rename. Enter OrderSummary.

In the Query Editor, click Data Sheet.

The data sheet should look similar to the following illustration.


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