Hai Fansul, Seperti Pak Bowo bilang, ALTER tidak bisa di lakukan di PLSQL.
Gunakan EXECUTE IMMEDIATE '<alter command disini>'; Coba lagi. Cheers, Yoel Susanto On Tue, Apr 6, 2010 at 10:11 AM, <[email protected]> wrote: > > > Hello Yoel, > > > Tuesday, April 6, 2010, 10:01:00 AM, you wrote: > > > tolong lakukan SHOW ERROR; setelah error compilation dan taruh di email. > > ini errornya pak > > Compilation errors for PROCEDURE insert_data_cabang > Error: PLS-00103: Encountered the symbol "ALTER" when expecting one of the > following: > begin case declare end exception exit for goto if loop mod > null pragma raise return select update while with > <an identifier> <a double-quoted delimited-identifier> > <a bind variable> << close current delete fetch lock insert > open rollback savepoint set sql execute commit forall merge > pipe > Line: 199 > Text: ALTER SESSION > > > > Cheers, > > Yoel Susanto > > > On Tue, Apr 6, 2010 at 9:52 AM, <[email protected]<fansul%40yahoo.co.id>> > 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:[email protected] <fansul%40yahoo.co.id> <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] > > > ------------------------------------ > > > > -- > > -----------I.N.D.O - O.R.A.C.L.E--------------- > > Keluar: > > [email protected]<indo-oracle-unsubscribe%40yahoogroups.com> > > Website: http://indooracle.wordpress.com > > http://www.facebook.com/group.php?gid=51973053515 > > ----------------------------------------------- > > > Bergabung dengan Indonesia Thin Client User Groups, > > Terminal Server, Citrix, New Moon Caneveral, di: > > http://indo-thin.blogspot.comYahoo! Groups Links > > > -- > Best regards, > fansul mailto:[email protected] <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] ------------------------------------ -- -----------I.N.D.O - O.R.A.C.L.E--------------- Keluar: [email protected] Website: http://indooracle.wordpress.com http://www.facebook.com/group.php?gid=51973053515 ----------------------------------------------- Bergabung dengan Indonesia Thin Client User Groups, Terminal Server, Citrix, New Moon Caneveral, di: http://indo-thin.blogspot.comYahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/indo-oracle/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/indo-oracle/join (Yahoo! ID required) <*> To change settings via email: [email protected] [email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

