Thursday, 26 December 2013

Projects linked to Customers

-- derived from view 'PA_PROJECT_CUSTOMERS_V'
 
SELECT *
  FROM all_views
 WHERE view_name = 'PA_PROJECT_CUSTOMERS';
 
  SELECT ppa.segment1
       , pps.project_status_name status
       , ppta.project_type project_type
       , cv1.customer_name
       , cv1.customer_number custno
       , cv1.status
       , pc1.ship_to_address_id
       , pc1.bill_to_address_id
       , pc1.creation_date cr_date
       , pc1.project_relationship_code rel_code
       , pc1.inv_rate_type
       , pc1.default_top_task_cust_flag top_task_flag
       , haou.name hr_org
    FROM apps.pa_customer_relationships_v crv1
       , apps.pa_customers_v cv1
       , apps.pa_project_customers pc1
       , pa.pa_projects_all ppa
       , pa.pa_tasks pt
       , pa.pa_project_statuses pps
       , pa.pa_project_types_all ppta
       , hr.hr_all_organization_units haou
   WHERE pc1.customer_id = cv1.customer_id
     AND pc1.project_relationship_code = crv1.project_relationship_code
     AND pc1.project_id = ppa.project_id
     AND pc1.receiver_task_id = pt.task_id(+)
     AND ppa.carrying_out_organization_id = haou.organization_id
     AND ppa.project_status_code = pps.project_status_code(+)
     AND ppa.project_type = ppta.project_type(+)
ORDER BY 4;

No comments:

Post a Comment