Bisa dicoba dengan contoh script ini.
delete stock x
where nvl(x.a_pcs,0) = 0
and nvl(x.s_pcs,0) = 0 ;
and not exists (
select 1
from lokasi a
where a.cd_lokasi = x.cd_lokasi);
Dengan script seperti ini tidak perlu loop dan prosesnya lebih cepat.
Cheers,
Wadi Achmed
On Mon, Dec 7, 2009 at 7:55 PM, <[email protected]> wrote:
> Hello indo-oracle,
>
> bagaimana script menghapus record yang tidak ketemu atau tidak sama
> dengan.
> klu untuk sama dengan saya bisanya bikin seperti ini.
>
> for i in
> (
> select
> a.cd_lokasi as cd_lokasi
> from
> lokasi a
> )
> loop
> delete stock x
> where
> trim(x.cd_lokasi) = trim(i.cd_lokasi)
> and nvl(x.a_pcs,0) = 0
> and nvl(x.s_pcs,0) = 0 ;
> end loop ;
>
>
>
>
> --
> Best regards,
> fansul
> mailto:[email protected]
>
> __________________________________________________
> Apakah Anda Yahoo!?
> Lelah menerima spam? Surat Yahoo! memiliki perlindungan terbaik terhadap
> spam
> http://id.mail.yahoo.com
>
>
>
> ------------------------------------
>
> --
> -----------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
>
>
>
>
[Non-text portions of this message have been removed]