Dear Master oracle,
 
Mo tanya nih, 
Saya buat aplikasi kecil menggunakan form oracle dan nantinya akan di-copykan 
di Oracle Application.
Tujuannya bila saya tekan satu button, dengan trigger when-button-pressed; maka 
file excel dengan type csv file akan masuk ke tabel di Oracle Application.
Masalahnya kalau saya buat hanya di level form biasa, dan form ini tidak saya 
copykan ke Oracle Apps, maka data excel type csv file ini masuk ke table 
oracle; tapi begitu form ini saya copy ke oracle apps; maka data dari csv file 
ini tidak pernah ke-insert di table oraclenya. 
Untuk jelasnya saya kirimkan trigger when-button-pressed-nya :
 
DECLARE
 v_filename_d VARCHAR2(256) := '/usr/tmp/gt_prod_family_detail.csv';
 v_file_d TEXT_IO.file_type;
 v_text_d VARCHAR2(32767);
 
  n_pf_d NUMBER;
  n_item_code_d NUMBER;
  
  t_pf1_d NUMBER;
  t_pf2_d NUMBER;
  t_item_code1_d NUMBER;
  t_item_code2_d NUMBER;
  t_sisa_d NUMBER;
 
  v_pf_d VARCHAR2(10);
  v_item_code_d VARCHAR2(20);  
  v_min_prod_qty_per_week_d PLS_INTEGER;
 
BEGIN
  v_file_d := TEXT_IO.fopen(v_filename_d, 'r');
 LOOP
    TEXT_IO.get_line(v_file_d, v_text_d);
    
    n_pf_d := INSTR(v_text_d,chr(44),1,1);
    n_item_code_d := INSTR(v_text_d,chr(44),1,2);
    
    t_pf1_d := n_pf_d - 1;
    t_pf2_d := n_pf_d + 1;
    t_item_code1_d := n_item_code_d - (n_pf_d + 1);
    t_item_code2_d := n_item_code_d + 1;
    t_sisa_d := length(v_text_d) - n_item_code_d; 
    
    v_pf_d := REPLACE(SUBSTR(v_text_d,1,t_pf1_d),'"',NULL);
    v_item_code_d := REPLACE(SUBSTR(v_text_d,t_pf2_d,t_item_code1_d),'"',NULL);
    v_min_prod_qty_per_week_d := 
REPLACE(SUBSTR(v_text_d,t_item_code2_d,t_sisa_d),'"',NULL);
    
   INSERT INTO GT_PF_PROD_FAMILY_DETAIL (PROD_FAMILY, ITEM_CODE, 
MIN_PROD_QTY_PER_WEEK, CREATED_BY, CREATED_DATE) 
  VALUES (v_pf_d, v_item_code_d, 500, 0, sysdate); 
  COMMIT;
 END LOOP;
 TEXT_IO.fclose(v_file_d);
 
  EXCEPTION
   WHEN OTHERS THEN
      PESAN('Proses Upload Product Family Detail Selesai!!!');
      RETURN;
END; 
 
Saya juga pernah buat form untuk upload file excel (csv file) tapi type 
kolomnya adalah character semua dan setelah saya copykan formnya ke oracle 
apps; data bisa ter-insert ke table oracle.
Untuk kasus di atas, csv filenya adalah campuran antara character dan numerik. 
Saya kuatir untuk type numeriknya yang tidak pernah berhasil di-insert.

gimana caranya yah...tolongin dong...

Thanks atas bantuannya

gt


      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 


[Non-text portions of this message have been removed]

Kirim email ke