Difference between revisions of "OE.OC ORDERS (view)"

From dbscript Online Help
Jump to: navigation, search
Line 10: Line 10:
  
 
<pre>
 
<pre>
CREATE OR REPLACE SELECT o.order_id, o.order_mode,MAKE_REF(oc_customers,o.customer_id),
+
CREATE OR REPLACE VIEW OE.OC_ORDERS AS
 +
SELECT o.order_id, o.order_mode,MAKE_REF(oc_customers,o.customer_id),
 
         o.order_status,o.order_total,o.sales_rep_id,
 
         o.order_status,o.order_total,o.sales_rep_id,
 
       CAST(MULTISET(SELECT l.order_id,l.line_item_id,l.unit_price,l.quantity,
 
       CAST(MULTISET(SELECT l.order_id,l.line_item_id,l.unit_price,l.quantity,

Revision as of 21:10, 24 August 2009

wikibot

view OE.OC_ORDERS


CREATE OR REPLACE VIEW OE.OC_ORDERS AS 
SELECT o.order_id, o.order_mode,MAKE_REF(oc_customers,o.customer_id),
        o.order_status,o.order_total,o.sales_rep_id,
       CAST(MULTISET(SELECT l.order_id,l.line_item_id,l.unit_price,l.quantity,
                       make_ref(oc_product_information,l.product_id)
                     FROM order_items l
                     WHERE o.order_id = l.order_id)
            AS order_item_list_typ)
    FROM orders o