Welcome Guest, you are in: Login

devio dbscript ScrewTurn Wiki

RSS RSS

Navigation





Search the wiki
»

PoweredBy

OE OC_CORPORATE_CUSTOMERS (view)

RSS
Modified on 2011/08/27 12:10 by wikibot Categorized as Uncategorized

wikibot

ViewOE.OC_CORPORATE_CUSTOMERS

Source

CREATE OR REPLACE VIEW OE.OC_CORPORATE_CUSTOMERS AS 
SELECT c.customer_id, c.cust_first_name, c.cust_last_name,
              c.cust_address, c.phone_numbers,c.nls_language,c.nls_territory,
              c.credit_limit, c.cust_email,
              CAST(MULTISET(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
                            WHERE c.customer_id = o.customer_id)
             

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam.