top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to import data from file into database?

+2 votes
266 views
How to import data from file into database?
posted Sep 15, 2014 by Arun Gowda

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

create or replace procedure proc2 is
vfileID utl_file.file_type;
vstring varchar2(100);
vcode varchar2(10);
vname varchar2(10);
begin
vfileID:=utl_file.fopen('D:\','pra1.DAT','R');
loop
utl_file.Get_line(vfileID,vstring);
vcode :=substr (vstring,1,2);
vname :=substr(vstring,4);
insert into hari(code,name)
values(vcode,vname);
commit;
end loop;
EXCEPTION
when NO_DATA_FOUND then
utl_file.fclose(vfileID);
end;

answer Sep 15, 2014 by Suchithra
...