Created
April 17, 2014 01:02
-
-
Save widoyo/10946079 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE PROCEDURE insert_a | |
AS | |
tgl varchar2(12); | |
msg varchar2(3500); | |
JAM DATE; | |
file UTL_FILE.FILE_TYPE; | |
bat UTL_FILE.FILE_TYPE; | |
file_scripts UTL_FILE.FILE_TYPE; | |
begin | |
file := UTL_FILE.FOPEN('C:\TEMP', 'insert A.txt','w', 8000); | |
msg := 'delete from A;'; | |
UTL_FILE.PUT_LINE(file,msg); | |
FOR X IN ( select (''''||nim||''','''||nama||''','''||alamat||'''') as isi FROM tabel_sumber_data_A) | |
LOOP | |
msg := 'insert into A (nim, nama, alamat) VALUES('|| X.isi ; | |
UTL_FILE.PUT_LINE(file,msg); | |
END LOOP; | |
UTL_FILE.FCLOSE_ALL; | |
end; | |
/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment