Getting invalid file operation when using the below code.
Iam running this on client machine and have created one director by name 'DEEPS' and have given read/write privileges ran the below quries for setting path.
If i cannot run this porcedure on client machine. please help me for reading data from .txt file and updating into database with out using UTL packages.
Please help
[code=oracle]
create or replace procedure utl_file_test_r ead (
direc in varchar2,
filename in varchar2)
is
input_file utl_file.file_t ype;
input_buffer varchar2(4000);
begin
input_file := utl_file.fopen( direc ,filename, 'R');
loop
utl_file.get_li ne(input_file,i nput_buffer);
insert into SampleTable values (input_buffer);
c := c + 1;
end loop;
exception
when NO_DATA_FOUND then
utl_file.fclose ( input_file);
end;
[/code]
Iam running this on client machine and have created one director by name 'DEEPS' and have given read/write privileges ran the below quries for setting path.
If i cannot run this porcedure on client machine. please help me for reading data from .txt file and updating into database with out using UTL packages.
Please help
[code=oracle]
create or replace procedure utl_file_test_r ead (
direc in varchar2,
filename in varchar2)
is
input_file utl_file.file_t ype;
input_buffer varchar2(4000);
begin
input_file := utl_file.fopen( direc ,filename, 'R');
loop
utl_file.get_li ne(input_file,i nput_buffer);
insert into SampleTable values (input_buffer);
c := c + 1;
end loop;
exception
when NO_DATA_FOUND then
utl_file.fclose ( input_file);
end;
[/code]
Comment