SQL Language (MOSC)

MOSC Banner

An object view references itself?

edited Jan 18, 2012 10:37AM in SQL Language (MOSC) 6 comments
Hi, How can a view references itself? Here is an example

CREATE OR REPLACE VIEW oe.oc_customers (
  customer_id,
  cust_first_name,
  cust_last_name,
  cust_address,
  phone_numbers,
  nls_language,
  nls_territory,
  credit_limit,
  cust_email,
  cust_orders
)
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(oe.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,

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center