MDAC 2.5 SDK - OLE DB Providers
Data Shaping Service for OLE DB


 

Parameterized Computed Child Rowsets

                   

The Data Shaping Service for OLE DB allows you to insert another level of child rowsets while still executing the parameterized command for the lowest child rowset. This allows you to build parameterized hierarchies that have one or more computed rowsets between the parent rowset that supplies the parameter values and the child rowset created by the parameterized provider command. The parameters are implicitly added to the computed rowset as hidden columns and implicitly become part of the BY clause.

Consider a hierarchy built upon a parameterized compute statement:

SHAPE {select * from Customers}  
   APPEND 
      ((SHAPE 
         {select orders.cust_id, orderItem.* from Orders, OrderItem 
            where cust_id = ? and orders.order_id = orderItems.order_id}
            AS rsOrderItems
         COMPUTE rsOrderItems BY order_id)
      RELATE cust_id to PARAMETER 0) 
   AS chpCustOrder

This results in the following: