Command ALTER ... tidak bisa dimasukkan ke dalam PL/SQL (procedure), cmiiw, Bowo
--- In [email protected], Yoel Susanto <yoel.susa...@...> wrote: > > tolong lakukan SHOW ERROR; setelah error compilation dan taruh di email. > > Cheers, > Yoel Susanto > > > > > On Tue, Apr 6, 2010 at 9:52 AM, <fan...@...> wrote: > > > > > > > Hello Yoel, > > Monday, April 5, 2010, 5:28:26 PM, you wrote: > > > > Yang terjadi procedure yang pertama selalu sukses, pas mau jalankan > > procedure yang kedua yang keluar error. > > Ini scriptnya, tolong salahnya dimana. > > ALTER SESSION CLOSE DATABASE LINK <dbLink> harus di tulis di sebelah > > mana ya, saya coba tulis di paling bawah sebelum end, waktu di > > compiler error > > > > ini script untuk Cab A, Procedure yang 2nya lagi itu sama > > hanya beda di Dlink aja (Cabb dan CabC) > > tks > > > > --- > > > > create or replace procedure insert_data_cabang > > is > > > > vcount smallint; > > begin > > > > ---- Hapus data yang ada perubahan ----- > > > > for i in > > ( > > select > > a.nomor > > from > > jual_...@caba a > > where > > a.status = 'N' > > ) > > loop > > > > vcount := 0 ; > > select > > count(*) > > into > > vcount > > from > > jual_global b > > where > > trim(b.nomor) = trim(i.nomor) > > > > if vcount > 0 > > then > > > > delete jual_global x > > where > > trim(b.nomor) = trim(i.nomor) ; > > > > update jual_...@caba z > > set z.status = 'Y' > > where > > trim(i.nomor) = trim(z.nomor) ; > > > > end if; > > end loop; > > commit ; > > ------------------- > > > > for i in > > ( > > select > > c.nomor, > > sum(c.nilai) as nilai > > from > > jual_i...@caba c > > where > > c.status = 'N' > > group by > > c.nomor > > ) > > > > loop > > > > vcount := 0; > > select > > count(*) > > into > > vcount > > from jual_global x > > where > > trim(x.nomor) = trim(i.nomor) ; > > > > if vcount > 0 > > then > > update jual_global x > > set x.nilai = nvl(i.nilai,0) > > where > > trim(x.nomor) = trim(i.nomor) ; > > else > > insert into jual_global x > > ( > > x.nomor, > > x.nilai > > ) > > values > > ( > > i.nomor, > > i.nilai > > ); > > end if ; > > > > update jual_i...@caba z > > set z.status = 'Y' > > where > > trim(i.nomor) = trim(z.nomor) ; > > end loop; > > commit; > > > > ---- masih error untuk Alter --- > > > > -- ALTER SESSION > > -- CLOSE DATABASE LINK CabA; > > > > end; > > > > > > > Meskipun process sudah selesai, database link itu gak akan di close kalo > > > sessionnya tidak di close > > > > > Solusi: > > > Lakukan COMMIT kemudian ALTER SESSION CLOSE DATABASE LINK <dbLink> setiap > > > selesai 1 procedurenya. > > > > -- > > Best regards, > > fansul > > mailto:fan...@... <fansul%40yahoo.co.id> > > > > __________________________________________________ > > Apakah Anda Yahoo!? > > Lelah menerima spam? Surat Yahoo! memiliki perlindungan terbaik terhadap > > spam > > http://id.mail.yahoo.com > > > > > > > > > [Non-text portions of this message have been removed] >

