|
-
Not exactly sure what you mean, but here is how I used Utl_file recently. I used it to read in a parameter file.
v_dir varchar2(4) := 'C:\';
v_name varchar2(20) := 'rangerulesinput.txt';
dbms_output.enable(1000000);
v_inputfile := utl_file.fopen(v_dir,v_name,'r');
Loop
cntr := cntr + 1;
begin
utl_file.get_line(v_inputfile,v_inputfield);
dbms_output.put_line ('Read in record '|| v_inputfield);
EXCEPTION
when no_data_found then
exit;
END;
if cntr = 1 then
target_inst := substr(v_inputfield,16,4);
end if;
if cntr = 2 then
new_model_1 := substr(v_inputfield,16,4);
end if;
if cntr = 3 then
new_model_2 := substr(v_inputfield,16,4);
end if;
if cntr = 4 then
new_model_3 := substr(v_inputfield,16,4);
end if;
if cntr = 5 then
new_model_4 := substr(v_inputfield,16,4);
end if;
if cntr = 6 then
new_model_5 := substr(v_inputfield,16,4);
end if;
END LOOP;
utl_file.fclose(v_inputfile);
Hope this helps.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|