2 Replies Latest reply: Nov 26, 2012 12:37 AM by AlexAnd RSS

    HZ_CUST_ACCT_SITES_ALL not retrieved any rows in APPS schema

    user10977928
      Hi Experts,

      Please help me to solve this issue.
      I log in my sqldeveloper by 'APPS' user.

      When i fired the query SELECT * FROM apps.HZ_CUST_ACCT_SITES it's not retrieved any rows.

      But when i fired select * from AR.HZ_CUST_ACCT_SITES_ALL then it will retrieved the rows.

      I checked the HZ_CUST_ACCT_SITES it's a synonym of AR.HZ_CUST_ACCT_SITES_ALL.

      Could you please help me to understand the reason why the first query not retrieved any rows or something i missed?

      Thanks in advance.
        • 1. Re: HZ_CUST_ACCT_SITES_ALL not retrieved any rows in APPS schema
          HrishikeshJ
          Hi,

          You will need to set Multi Org context without which you will not be able to query data form tables like HZ_CUST_ACCT_SITES.
          you will still be able to query data from HZ_CUST_ACCT_SITES_ALL.

          Just execute following block from sql, and then you should be able to query form HZ_CUST_ACCT_SITES.

          BEGIN
          fnd_global.apps_initialize(&user_id, &resp_id, &application_id);
          mo_global.init('AR');
          MO_GLOBAL.SET_POLICY_CONTEXT('S',p_org_id);
          END;

          you can user AR Super User's responsibility id.
          p_org_id is the OU's org_id

          Thanks,
          Hrishi
          • 2. Re: HZ_CUST_ACCT_SITES_ALL not retrieved any rows in APPS schema
            AlexAnd
            >
            the HZ_CUST_ACCT_SITES it's a synonym of AR.HZ_CUST_ACCT_SITES_ALL.
            >
            yes

            HZ_CUST_ACCT_SITES is synonym with security
            as you is not initialize then you anonymous so you haven't data

            plz see
            SQL Queries and Multi-Org Architecture in Release 12 [ID 462383.1]
            R12: How to Set the ORG_ID (org context) Before Running a Statement in SQL*Plus? [ID 753178.1]


            >
            Could you please help me to understand the reason why the first query not retrieved any rows or something i missed?
            >
            you missed security