Associative array in select statement as normal database table
Step 1
First Create Associative Array Type
TYPE assoc_array_type IS TABLE OF VARCHAR2(150) INDEX BY BINARY_INTEGER;
if required We can use as Cursor parameter but this is optional
function or procedure_name (Parameter1 datatype)
DECLARE SECTION
assoc_var assoc_array_type;
CURSOR invoice_cur(cur_para_assocv assoc_array_type) IS
SELECT DISTINCT
trx_head.trx_number invoice_number,
cust_acct.cust_account_id,
SUBSTR(cust_acct.account_number,7,6) customer_number,
cust_acct.account_name,
loc.address1,
loc.address2,
loc.address3,
loc.address4,
loc.city,
loc.county,
loc.state,
loc.postal_code,
loc.country,
term.NAME payment_term,
trx_head.term_id term_id,
trx_head.cust_trx_type_id trx_type_id,
trx_head.bill_to_site_use_id,
trx_head.bill_to_contact_id,
party_sites.party_id,
cust_acct.account_number
FROM
ra_customer_trx trx_head,
ra_cust_Trx_types trx_types,
hz_locations loc,
ra_terms term,
hz_cust_accounts cust_acct,
hz_party_sites party_sites,
hz_cust_acct_sites cust_acct_sites,
hz_cust_site_uses cust_site_uses
WHERE cust_acct.cust_account_id = trx_head.bill_to_customer_id
AND term.term_id = trx_head.term_id
AND trx_head.cust_trx_type_id = trx_types.cust_trx_type_id
AND loc.location_id = party_sites.location_id
AND party_sites.party_site_id = cust_acct_sites.party_site_id
AND cust_acct_sites.cust_acct_site_id = cust_site_uses.cust_acct_site_id
AND cust_acct_sites.cust_account_id = cust_acct.cust_account_id
AND cust_site_uses.site_use_id = trx_head.bill_to_site_use_id
AND term.due_cutoff_day IS NULL
AND trx_head.complete_flag = 'Y'
AND trx_head.printing_option = 'PRI'
AND trx_head.bill_to_customer_id IS NOT NULL
AND cust_acct_sites.attribute9 IS NOT NULL
AND cust_acct_sites.attribute9 IN (SELECT * FROM TABLE(cur_para_assocv))
-- The above show the associative array used as normal Table.
BEGIN SECTION
..................... IF SOME STATEMENTS REQUIRED YOU CAN USE HERE
if Parameter1 ='REST ALL' then
select distinct attribute9 BULK COLLECT INTO assoc_var from apps.hz_cust_acct_sites_all where org_id=apps.FND_PROFILE.VALUE('ORG_ID') and (ATTRIBUTE9 NOT LIKE 'XXX' AND ATTRIBUTE9 NOT LIKE 'YYY' AND ATTRIBUTE9 NOT LIKE 'ZZZ' ) ;
elsif Parameter1 ='XXX' then
select distinct attribute9 BULK COLLECT INTO assoc_var from apps.hz_cust_acct_sites_all where org_id=apps.FND_PROFILE.VALUE('ORG_ID') and ATTRIBUTE9 LIKE 'XXX%' ;
elsif Parameter1 ='YYY' THEN
select distinct attribute9 BULK COLLECT INTO assoc_var from apps.hz_cust_acct_sites_all where org_id=apps.FND_PROFILE.VALUE('ORG_ID') and ATTRIBUTE9 LIKE 'YYY%' ;
elsif Parameter1='ZZZ' then
select distinct attribute9 BULK COLLECT INTO assoc_var from apps.hz_cust_acct_sites_all where org_id=apps.FND_PROFILE.VALUE('ORG_ID') and ATTRIBUTE9 LIKE 'ZZZ%' ;
else
select distinct attribute9 BULK COLLECT INTO assoc_var from apps.hz_cust_acct_sites_all where org_id=apps.FND_PROFILE.VALUE('ORG_ID');
end if;
FOR invoice_rec IN invoice_cur (assoc_var )
LOOP
...................
...................SOME STATEMENTS HERE
END LOOP;
END ;
Step 1
First Create Associative Array Type
TYPE assoc_array_type IS TABLE OF VARCHAR2(150) INDEX BY BINARY_INTEGER;
if required We can use as Cursor parameter but this is optional
function or procedure_name (Parameter1 datatype)
DECLARE SECTION
assoc_var assoc_array_type;
CURSOR invoice_cur(cur_para_assocv assoc_array_type) IS
SELECT DISTINCT
trx_head.trx_number invoice_number,
cust_acct.cust_account_id,
SUBSTR(cust_acct.account_number,7,6) customer_number,
cust_acct.account_name,
loc.address1,
loc.address2,
loc.address3,
loc.address4,
loc.city,
loc.county,
loc.state,
loc.postal_code,
loc.country,
term.NAME payment_term,
trx_head.term_id term_id,
trx_head.cust_trx_type_id trx_type_id,
trx_head.bill_to_site_use_id,
trx_head.bill_to_contact_id,
party_sites.party_id,
cust_acct.account_number
FROM
ra_customer_trx trx_head,
ra_cust_Trx_types trx_types,
hz_locations loc,
ra_terms term,
hz_cust_accounts cust_acct,
hz_party_sites party_sites,
hz_cust_acct_sites cust_acct_sites,
hz_cust_site_uses cust_site_uses
WHERE cust_acct.cust_account_id = trx_head.bill_to_customer_id
AND term.term_id = trx_head.term_id
AND trx_head.cust_trx_type_id = trx_types.cust_trx_type_id
AND loc.location_id = party_sites.location_id
AND party_sites.party_site_id = cust_acct_sites.party_site_id
AND cust_acct_sites.cust_acct_site_id = cust_site_uses.cust_acct_site_id
AND cust_acct_sites.cust_account_id = cust_acct.cust_account_id
AND cust_site_uses.site_use_id = trx_head.bill_to_site_use_id
AND term.due_cutoff_day IS NULL
AND trx_head.complete_flag = 'Y'
AND trx_head.printing_option = 'PRI'
AND trx_head.bill_to_customer_id IS NOT NULL
AND cust_acct_sites.attribute9 IS NOT NULL
AND cust_acct_sites.attribute9 IN (SELECT * FROM TABLE(cur_para_assocv))
-- The above show the associative array used as normal Table.
BEGIN SECTION
..................... IF SOME STATEMENTS REQUIRED YOU CAN USE HERE
if Parameter1 ='REST ALL' then
select distinct attribute9 BULK COLLECT INTO assoc_var from apps.hz_cust_acct_sites_all where org_id=apps.FND_PROFILE.VALUE('ORG_ID') and (ATTRIBUTE9 NOT LIKE 'XXX' AND ATTRIBUTE9 NOT LIKE 'YYY' AND ATTRIBUTE9 NOT LIKE 'ZZZ' ) ;
elsif Parameter1 ='XXX' then
select distinct attribute9 BULK COLLECT INTO assoc_var from apps.hz_cust_acct_sites_all where org_id=apps.FND_PROFILE.VALUE('ORG_ID') and ATTRIBUTE9 LIKE 'XXX%' ;
elsif Parameter1 ='YYY' THEN
select distinct attribute9 BULK COLLECT INTO assoc_var from apps.hz_cust_acct_sites_all where org_id=apps.FND_PROFILE.VALUE('ORG_ID') and ATTRIBUTE9 LIKE 'YYY%' ;
elsif Parameter1='ZZZ' then
select distinct attribute9 BULK COLLECT INTO assoc_var from apps.hz_cust_acct_sites_all where org_id=apps.FND_PROFILE.VALUE('ORG_ID') and ATTRIBUTE9 LIKE 'ZZZ%' ;
else
select distinct attribute9 BULK COLLECT INTO assoc_var from apps.hz_cust_acct_sites_all where org_id=apps.FND_PROFILE.VALUE('ORG_ID');
end if;
FOR invoice_rec IN invoice_cur (assoc_var )
LOOP
...................
...................SOME STATEMENTS HERE
END LOOP;
END ;
Kocaeli
ReplyDeleteDenizli
Bursa
istanbul
Van
ZJA
Kastamonu Lojistik
ReplyDeleteYozgat Lojistik
Çorlu Lojistik
Kırşehir Lojistik
Sinop Lojistik
NLPT6
E575D
ReplyDeleteKilis Evden Eve Nakliyat
Bingöl Evden Eve Nakliyat
Karabük Evden Eve Nakliyat
Niğde Lojistik
Gümüşhane Evden Eve Nakliyat
79E47
ReplyDeleteAdana Parça Eşya Taşıma
Bursa Evden Eve Nakliyat
Mardin Lojistik
İzmir Parça Eşya Taşıma
Amasya Parça Eşya Taşıma
145EC
ReplyDeleteTekirdağ Evden Eve Nakliyat
Bilecik Evden Eve Nakliyat
Karabük Evden Eve Nakliyat
Aksaray Evden Eve Nakliyat
Niğde Evden Eve Nakliyat
585D8
ReplyDeleteÜnye Kurtarıcı
Kucoin Güvenilir mi
Amasya Parça Eşya Taşıma
Silivri Boya Ustası
Van Lojistik
Ünye Organizasyon
Altındağ Parke Ustası
Muğla Şehirler Arası Nakliyat
Afyon Lojistik
BB2BD
ReplyDeleteDüzce Evden Eve Nakliyat
Manisa Lojistik
Aksaray Parça Eşya Taşıma
Manisa Parça Eşya Taşıma
Eskişehir Şehirler Arası Nakliyat
Yenimahalle Parke Ustası
Bayburt Evden Eve Nakliyat
Okex Güvenilir mi
Nevşehir Evden Eve Nakliyat
3839D
ReplyDeleteÇerkezköy Parke Ustası
Batman Lojistik
İzmir Parça Eşya Taşıma
Düzce Parça Eşya Taşıma
Yenimahalle Fayans Ustası
Sinop Lojistik
Muğla Lojistik
Bursa Şehirler Arası Nakliyat
Antalya Şehirler Arası Nakliyat
1C780
ReplyDeleteBursa Şehirler Arası Nakliyat
Yalova Lojistik
Aydın Şehir İçi Nakliyat
Bolu Lojistik
Sinop Evden Eve Nakliyat
Denizli Evden Eve Nakliyat
Çerkezköy Halı Yıkama
Paribu Güvenilir mi
Çankırı Lojistik
5DA94
ReplyDelete%20 binance komisyon indirimi
28AC0
ReplyDeleteAnkara Parasız Sohbet Siteleri
gümüşhane sesli mobil sohbet
Karabük Bedava Sohbet Uygulamaları
Adıyaman Sesli Sohbet Sesli Chat
kayseri en iyi rastgele görüntülü sohbet
tunceli mobil sohbet et
Ankara Canlı Görüntülü Sohbet
aydın canlı sohbet sitesi
Artvin Görüntülü Sohbet Kadınlarla
87E07
ReplyDeleteClysterum Coin Hangi Borsada
Parasız Görüntülü Sohbet
Sonm Coin Hangi Borsada
Tumblr Takipçi Hilesi
Onlyfans Beğeni Satın Al
Binance Kaldıraçlı İşlem Nasıl Yapılır
Bitcoin Mining Nasıl Yapılır
Görüntülü Sohbet Parasız
Soundcloud Dinlenme Hilesi
3C736
ReplyDeleteSnapchat Takipçi Hilesi
Binance Ne Kadar Komisyon Alıyor
Twitch İzlenme Hilesi
Binance Sahibi Kim
Instagram Takipçi Hilesi
Btcturk Borsası Güvenilir mi
Soundcloud Beğeni Satın Al
Binance Hesap Açma
Madencilik Nedir