Integrated Document Solutions
for Business Applications

New Blog Posts

  • May 2nd 2013 JDE’s Most Powerful Work Order Printing Solution Turns it Up a Notch with Version 2.0 Read More
  • May 1st 2013 Pinching Back: The Difference One Day Can Make in Delivering AR Invoices Read More
  • April 23rd 2013 Easily Add New Document Types for Delivery from AventX Oracle Connector Read More
  • February 11th 2013 2012: A Noteworthy Year for STR Software Read More

What’s New

Home / Blog / Current Page

BI Publisher Enterprise – Bursting From Multiple Data Sources Using Cursor Expressions

Posted on by Brent Lowe

From my previous post regarding Bursting from Multiple Data Sources I had assumed that Kris’ comment meant that he had data in separate databases. After some discussion with him, I learned that the data was in the same database and he was using multiple SQL queries to get the information.

However, the problem was the same as the SQL queries return the data and BIP groups it accordingly. Unfortunately, the data was returned in such a way that the XML that was created was not formed to burst correctly. Data Templates would have worked for him, however he took a different route. One I definitely had not thought about.

Instead of using Data Templates, Kris condensed his multiple queries to a single SQL query that employed the use of Cursor Expressions to ensure that the data was returned in a way that would produce XML with the correct grouping of elements.

Let’s take a look at an example using the standard data for the Overdue Invoice Report I have been using for all of my posts.

For my example, I have 2 tables.

demo_customers has all of the information about my customers.
demo_invoices has all of the information about my customer’s invoices.

I want to create a report that shows overdue invoices by customer using a single query and without using Data Templates.

To do this I would use the following query using cursor expressions:

select customer_id,
customer_name,
cursor (
select invoice_number, invoice_amount
from demo_invoices i
where i.invoice_overdue = 'Y' and i.customer_id = c.customer_id) invoices
from demo_customers c

This query will output the following XML, which as you can see is grouped appropriately (top level of customers with child nodes for each customer’s invoices) to ensure that I can create a template with relative ease as well as burst.

BI Publisher XML with Correct Grouping

Thanks for the information Kris, I’m sure it will help others!

Related resources:

 


Share this Article


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>