bea.com | products | dev2dev | support | askBEA

Download Docs | Site Map | Glossary
Search

Building Queries and Data Views

Query Cookbook

This section provides examples of more complex BEA Liquid Data for WebLogicTM queries using some of the advanced features and tools offered in the Data View Builder. At this point, we assume that you are familiar with the Data View Builder user interface (described in Starting the Builder and Touring the GUI) and that you have an understanding of the basic concepts and tasks presented in Getting Started, Overview and Key Concepts, and Designing Queries.

The following use cases and examples are provided here to give you a jump-start for constructing real-world queries to solve common problems. Each use case includes a viewlet demo of building the solution using Data View Builder. Watching a viewlet takes 3 to 5 minutes—we suggest sitting back and enjoying with popcorn and your favorite soda pop.

- Example 1: Simple Joins (View a Demo)

- Example 2: Aggregates (View a Demo)

- Example 3: Date and Time Duration (View a Demo)

- Example 4: Union (View a Demo)

- Example 5: Minus (View a Demo)

- Example 6: Complex Parameter Type (CPT) (View a Demo)

For an example of using a stored procedure in a query, see Example: Defining and Using a Customer Orders Stored Procedure.

Each use case has an example with a description of the problem and the steps to solve the problem. The examples use two databases:

- The Broadband database (PB-BB) contains "Broadband" subscribers and service orders

- The Wireless database (PB-WL) contains "Wireless" subscribers.

In cases where the target schemas do not already exist in the Samples repository, they are provided in this documentation along with the examples. You can cut-and-paste the schema content into an .xsd file to construct your own target schemas. (You can also copy from the PDF version of this document which may give you a copy that formats better your text editor.)

Note: To find out what data are contained in any data source, create a new "test" project, open the source schema you are interested in, and map key source nodes to any appropriate target schema. (For example, map customer first and last names and customer ID from source to target schemas.) Then click on Test tab and choose Query—>Run Query. The result will return all customers in the data source queried.

As you work through the examples, remember to save any projects that you want to keep before creating new ones.

Example directories

Examples used in this chapter assume that the Liquid Data 1.1 directory is located at:

>     BEAHOME/weblogic700/liquiddata/

where BEAHOME is the location of the WebLogic server and liquiddata is the location of the Liquid Data 1.1 Samples server installation.

The examples also assume that the path to the Samples server Liquid Data repository is:

>     BEAHOME/weblogic700/liquiddata/samples/config/ld_samples/ldrepository

The symbolic name ld_repository represents the Liquid Data repository and its contents.