Ada sih cata lain, spt bikin field kode lama di tabel customer, tp kayaknya ganti fungsi cara yg lebih cepat deh.
Hehe selamat nyari kutu deh pit, pake visual expert aja buat search impact analisisnya. On Mar 25, 2011 2:06 PM, "Gunawan, PE (Peter)" <[email protected]> wrote: > Dear PB-ers, > Butuh bantuannya nih: > Case : di nv_app_manager ada function untuk check dan get sequence (running number) untuk pembuatan code dari suatu master tabel. Misal : customer code untuk tabel customer. > Nah dari semua master itu code nya numeric. Tiba2 master customer, customer code type nya diubah menjadi string dengan isinya tetap numeric. > > Di screen master customer, ada panggil function2 tersebut. Argumennya code dari table master sequence. Di table master sequence itu ada informasi table master apa yang perlu dicek, kolom apa dan value running numbernya. Nah di function itu akan membuat query : > select count untuk mengecek di table where kolom nya = running number. > Untuk mengecek keberadaan di master customer dengan customer code = yang di running number (mengecek duplikasi). > > Berhubung kolom customer code sudah jadi string otomatis query bentukan itu jadi tidak menghasilkan data dan error. > Karena query yang seharusnya (query 1): > Select count(*) from customer where customer code = '145' > Atau query lain (query 2): > Select count(*) from customer where convert(int,customer code) = 145 > Sementara query hasil bentukan (query 3) : > Select count(*) from customer where customer code = 145 > Query 3 ini jadi menghasilkan error. Karena kolom customer code type nya string. > > Ada ide supaya tidak perlu membuat function2 baru untuk check dan get sequence (khusus customer) ? > Sebagai catatan untuk membuat query, sudah ada argument table name, column name dan value where clause (145) > Saya ada ide sewaktu generate query nya ada penambahan validasi, kalau khusus customer (hardcoded) query nya diubah menjadi 1 atau 2, selain itu tetap query asal. > Atau khusus untuk master customer, memanggil 2 function baru. > > Ada ide lain?? > Thanks atas bantuannya. > > > Regards, > Peter Gunawan > > > Rabobank International Indonesia > ITSD Department > Postal address: Jl. Tanah Abang II No.89 Jakarta 10150, Indonesia > Telephone: (62)-(21) 3506969, 3500570 ext.2055 > Email: [email protected]<mailto:[email protected]> > Website: www.rabobank.com<http://www.rabobank.com/> > > P Please consider the environment before printing this e-mail > > > _____________________________________________________________ > > This email (including any attachments to it) is confidential, legally privileged, subject to copyright and is sent for the personal attention of the intended recipient only. If you have received this email in error, please advise us immediately and delete it. You are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. Although we have taken reasonable precautions to ensure no viruses are present in this email, we cannot accept responsibility for any loss or damage arising from the viruses in this email or attachments. We exclude any liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided in this email or its attachments, unless that information is subsequently confirmed in writing. If this email contains an offer, that should be considered as an invitation to treat. > _____________________________________________________________
