bea.com | products | dev2dev | support | askBEA
 Download Docs   Site Map   Glossary 
Search

Building Queries and Data Views

 Previous Next Contents Index View as PDF  

Overview and Key Concepts

W3C XQuery, XML, and Liquid Data

How Do Liquid Data and Data View Builder Use XQuery?

The Role of XML in Creating Global Business Solutions

Which Versions of XML Schema Does Liquid Data Support?

How Can I Learn More About the XQuery Language?

What is the Data View Builder?

Why Do I Need it?

How Does it Work?

Key Concepts of Query Building

Query Plans

Stored Queries

Ad Hoc Queries

Different Kinds of Data Sources

Relational Databases

XML Files

Web Services

Application Views

Data Views—Using the Result of a Query as a Data Source

Source and Target Schemas

Understanding Source Schemas

Understanding Target Schemas

Anatomy of a Query: Joins, Unions, Aggregates, and Functions

Joins

Unions

Aggregates

Functions

Next Steps

Starting the Builder and Touring the GUI

Starting the Data View Builder

Data View Builder GUI Tour

Design Tab

Overview Picture of Design Tab Components

1. Menu Bar for the Design Tab

2. Toolbar for the Design Tab

3. Builder Toolbar

4. Source Schemas

5. Target Schema

6. Conditions Tab

7. Mappings Tab

8. Sort By Tab

9. Status Bar

Optimize Tab

Overview Picture of Optimize Tab Components

1. Source Order Optimization

2. Join Pair Hints

Test Tab

Overview Picture of Test Tab Components

1. Menu Bar for the Test Tab

2. Toolbar for the Test Tab

3. Builder-Generated XQuery

4. Query Parameters: Submitted at Query Runtime

5. Query Results - Large Results

6. Run Query

7. Result of a Query

Working With Projects

To Make a Project Portable, Save Target Schema to Repository

Saving a Project is Not the Same as Saving a Query

Special Characters: Occurrence Indicators

Next Steps: Building and Testing Sample Queries

Designing Queries

Designing a Query

Building a Query

Opening the Source Schemas for the Data Sources You Want to Query

Adding a Target Schema

Editing a Target Schema

Mapping Source and Target Schemas

Mapping Node to Node

Example: Query Customers by State

Mapping Nodes to Functions

Supported Mapping Relationships

Removing Mappings

Setting Conditions

What are Functions?

Using Constants and Variables in Functions

Removing Conditions

Adding or Deleting Parameters in a Condition Statement

Showing or Hiding Data Types

Using Automatic Type Casting

Exceptions to Automatic Type Casting

Examples of Simple Queries

Example: Return Customers by Name

Build the Query

View the XQuery and Run the Query to Test it

Example: Query Customers by ID and Sort Output by State

Open the Data Sources and Add a Target Schema

Map Nodes from Source to Target Schema to Project Output

Join Two Sources

Specify the Order of the Result Using the Sort By Features

View the XQuery and Run the Query to Test it

Understanding Scope in Basic and Advanced Views

Where Does Scope Apply?

Basic View (Automatic Scope Settings)

Advanced View (Setting the Scope Manually)

When to Use Advanced View to Set Scope Manually

Task Flow Model for Advanced View Manual Scoping

Returning to Basic View

Saving Projects from Basic or Advanced View

Version Control

Scope Recursion Errors

Recommended Action

Understanding Query Design Patterns

Target Schema Design Guidelines and Query Examples

Design Guidelines

Examples of Effective Query Design

Source Replication

Why is source replication necessary?

When is source replication necessary?

When should you manually replicate sources?

Next Steps

Optimizing Queries

Factors in Query Performance

Using the Features on the Optimize Tab

Source Order Optimization

Example: Source Order Optimization

Optimization Hints for Joins

Choosing the Best Hint

Using Parameter Passing Hints (ppleft or ppright)

Using a Merge Hint

Testing Queries

Switching to the Test View

Using Query Parameters

Specifying Large Results for File Swapping

Running the Query

Viewing the Query Result

Saving a Query

Saving a Query to the Repository as a "Stored Query"

Naming Conventions for Stored Queries

Query Cookbook

Example 1: Simple Joins

The Problem

The Solution

View a Demo

Ex 1: Step 1. Verify the Target Schema is Saved in Repository

Ex 1: Step 2. Open Source and Target Schemas

Ex 1: Step 3. Map Nodes from Source to Target Schema to Project the Output

Ex 1: Step 4. Create a Query Parameter for a Customer ID to be Provided at Query Runtime

Ex 1: Step 5. Assign the Query Parameter to a Source Node

Ex 1: Step 6. Join the Wireless and Broadband Customer IDs

Ex 1: Step 7. Set Optimization Hints

Ex 1: Step 8. View the XQuery and Run the Query to Test it

Ex. 1: Step 9. Verify the Result

Example 2: Aggregates

The Problem

The Solution

View a Demo

Ex 2: Step 1. Locate and Configure the "AllOrders" Data View

Ex 2: Step 2. Restart the Data View Builder and Find the New Data View

Ex 2: Step 3. Verify the Target Schema is Saved in the Repository

Ex 2: Step 4. Open the Data Sources and Target Schema

Ex 2: Step 5. Map Source Nodes to Target to Project the Output

Ex 2: Step 6. Create Two Query Parameters to be Provided at Query Runtime

Ex 2: Step 7. Assign the Query Parameters to Source Nodes

Ex 2: Step 8. Add the "count" Function

Ex 2: Step 9. Verify Mappings and Conditions

Ex 2: Step 10. View the XQuery and Run the Query to Test it

Ex 2: Step 11. Verify the Result

Example 3: Date and Time Duration

The Problem

The Solution

View a Demo

Ex 3: Step 1. Verify the Target Schema is Saved in Repository

Ex 3: Step 2. Open Source and Target Schemas

Ex 3: Step 3. Map Source to Target Nodes to Project the Output

Ex 3: Step 4. Create Joins

Ex 3: Step 5. Create Two Query Parameters for Customer ID and Date to be Provided at Query Runtime

Ex 3: Step 6. Set a Condition Using the Customer ID

Ex 3: Step 7. Set a Condition to Determine if Order Ship Date is Earlier or Equal to a Date Submitted at Query Runtime

Ex 3: Step 8. Set a Condition to Include Only "Open" Orders in the Result

Ex 3: Step 9. View the XQuery and Run the Query to Test it

Ex 3: Step 9. Verify the Result

Example 4: Union

The Problem

The Solution

View a Demo

Ex 4: Step 1. Verify the Target Schema is Saved in Repository

Ex 4: Step 2. Open Source and Target Schemas

Ex 4: Step 3. Create a Query Parameter for a Customer ID

Ex 4: Step 4. Assign Parameters, Define Source Relationships, and Project the Output

Ex 4: Step 5. View the XQuery and Run the Query to Test it

Ex 4: Step 6. Verify the Result

Example 5: Minus

The Problem

The Solution

View a Demo

Ex 5: Step 1. Verify the Target Schema is Saved in Repository

Ex 5: Step 2. Open Source and Target Schemas

Ex 5: Step 3. Find Broadband and Wireless Customers with the Same Customer ID

Ex 5: Step 4. Count the Equalities

Ex 5: Step 5. Set a Condition that Specifies the Output of "count" is Zero

Ex 5: Step 6. View the XQuery and Run the Query to Test it

Ex 5: Step 7. Verify the Result

Using Data Views as Data Sources

Understanding the Relationship Between a Query and a Data View

When To Use Data Views as Data Sources

How to Reuse a Data View as a Data Source

Create the Query and Save it to the Liquid Data Repository

Configure a Data View Data Source Description for the Query

Re-start the Data View Builder and Verify the New Data View Source Shows Up

Data View Query Example

Functions Reference

Data Types

Naming Conventions

Occurrence Indicators

Accessor Functions

Aggregate Functions

Boolean Functions

Constructor Functions

DateTime Functions

xf:add-days

Data Types

Description

Notes

XQuery Specification Compliance

Examples

xf:current-dateTime

Data Types

Description

Notes

XQuery Specification Compliance

Example

xf:date

Data Types

Description

Notes

XQuery Specification Compliance

Examples

xfext:date-from-dateTime

Data Types

Description

Notes

XQuery Specification Compliance

Examples

xfext:date-from-string-with-format

Data Types

Description

Notes

XQuery Specification Compliance

Examples

xf:dateTime

Data Types

Description

Notes

XQuery Specification Compliance

Examples

xfext:dateTime-from-string-with-format

Data Types

Description

Notes

XQuery Specification Compliance

Examples

xf:get-hours-from-dateTime

Data Types

Description

Notes

XQuery Specification Compliance

Examples

xf:get-hours-from-time

Data Types

Description

Notes

XQuery Specification Compliance

Examples

xf:get-minutes-from-dateTime

Data Types

Description

Notes

XQuery Specification Compliance

Examples

xf:get-minutes-from-time

Data Types

Description

Notes

XQuery Specification Compliance

Examples

xf:get-seconds-from-dateTime

Data Types

Description

Notes

XQuery Specification Compliance

Examples

xf:get-seconds-from-time

Data Types:

Description

Notes

XQuery Specification Compliance

Examples

xf:time

Data Types

Description

Notes

XQuery Specification Compliance

Examples

xfext:time-from-dateTime

Data Types

Description

Notes

XQuery Specification Compliance

Examples

xfext:time-from-string-with-format

Data Types

Description

Notes

XQuery Specification Compliance

Examples

Date and Time Patterns

Node Functions

Numeric Functions

Comparison and Numeric Operators

Other Functions

Sequence Functions

Type Casting Functions

Supported Data Types

Overview

JDBC Types

JDBC Names

Oracle Names

Microsoft SQL Server Names

DB2 Names

Sybase Names

Type Casting Reference

Type Casting to a Numeric Target

Type Casting to a Non-Numeric Target

Type Casting Function Parameters

 

Back to Top Previous Next