94: xreturn_code OUT NOCOPY NUMBER) IS
95:
96: /* Local variables. */
97: l_cust_id hz_cust_accounts.cust_account_id%TYPE := 0;
98: l_site_id hz_cust_site_uses_all.site_use_id%TYPE := 0;
99: l_org_id hz_cust_site_uses_all.org_id%TYPE := 0;
100:
101:
102: /* Cursor Definitions. */
95:
96: /* Local variables. */
97: l_cust_id hz_cust_accounts.cust_account_id%TYPE := 0;
98: l_site_id hz_cust_site_uses_all.site_use_id%TYPE := 0;
99: l_org_id hz_cust_site_uses_all.org_id%TYPE := 0;
100:
101:
102: /* Cursor Definitions. */
103: /* =================== */
105: SELECT cust_acct.cust_account_id, site.site_use_id, site.org_id
106: FROM hz_parties party,
107: hz_cust_accounts cust_acct,
108: hz_cust_acct_sites_all acct_site,
109: hz_cust_site_uses_all site,
110: hz_party_sites party_site,
111: hz_locations loc
112: WHERE acct_site.cust_account_id=cust_acct.cust_account_id
113: and cust_acct.party_id=party.party_id
180: SELECT cust_acct.cust_account_id
181: FROM hz_parties party,
182: hz_cust_accounts cust_acct,
183: hz_cust_acct_sites_all acct_site,
184: hz_cust_site_uses_all site,
185: hz_party_sites party_site,
186: hz_locations loc
187: where acct_site.cust_account_id=cust_acct.cust_account_id
188: and cust_acct.party_id=party.party_id
198: SELECT site.site_use_id
199: FROM hz_parties party,
200: hz_cust_accounts cust_acct,
201: hz_cust_acct_sites_all acct_site,
202: hz_cust_site_uses_all site,
203: hz_party_sites party_site,
204: hz_locations loc
205: where acct_site.cust_account_id=cust_acct.cust_account_id
206: and cust_acct.party_id=party.party_id
217: SELECT site.org_id
218: FROM hz_parties party,
219: hz_cust_accounts cust_acct,
220: hz_cust_acct_sites_all acct_site,
221: hz_cust_site_uses_all site,
222: hz_party_sites party_site,
223: hz_locations loc
224: where acct_site.cust_account_id=cust_acct.cust_account_id
225: and cust_acct.party_id=party.party_id