ECC Service Contracts, Service Contract Risk Details, SQL1

Description
Columns: Ecc Spec Id, Contract Id, Risk Rating, Value Rating, Customer Party Name, Contract Number, Contract End Date, Contract Termination Date, Contract Status Group, Us Short Description ...
Imported from ECC
select * from (SELECT   ecc_spec_id,
  contract_id,
  risk_rating,
  value_rating,
  customer_party_name,
  short_description,
  contract_number,
  status_meaning,
  negotiation_sts_meaning,
   language_code ,
   contract_end_date,
   contract_termination_date ,
   contract_status_group
 FROM oks_k_risk_ecc_v WHERE ((contract_status_group = 'ACTIVE') or
(contract_status_group in ('EXPIRED', 'HOLD', 'SIGNED') and
    (contract_end_date >=  NVL(fnd_date.canonical_to_date(fnd_profile.value('OKS_ECC_CONTARCT_FROM_DATE')),sysdate))) or
(contract_status_group in ('TERMINATED') and
    (contract_termination_date >= NVL(fnd_date.canonical_to_date(fnd_profile.value('OKS_ECC_CONTARCT_FROM_DATE')),sysdate))) or
(contract_status_group in ('ENTERED','CANCELLED') and
    (contract_end_date >= NVL(fnd_date.canonical_to_date(fnd_profile.value('OKS_ECC_CONTARCT_FROM_DATE')),sysdate)))
)) pivot
(
max(Short_Description)	as	Short_Description	,
max(status_meaning)	as	status_meaning	,
max(negotiation_sts_meaning)	as	negotiation_sts_meaning
         for language_code in ('US' "US"))