[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2229
  • Last Modified:

using Oracle Forms 6i to load excel file into oracle table

I need an example on how to load excel file into Oracle table in Oracle Forms
0
ipesin
Asked:
ipesin
  • 2
1 Solution
 
schwertnerCommented:
SQL> create directory MYDIR as 'C:\MYIMAGE';

Directory created.

SQL> create table special(a number, b varchar2(20), c blob);

Table created.

SQL>
SQL> insert into special values(1,'abcd',empty_blob());

1 row created.

SQL>
SQL> commit;

Commit complete.


create or replace procedure load(id number)
is
dest_lob blob;
src_lob bfile:=bfilename('MYDIR','file.bmp');
amt integer:=sys.dbms_lob.getlength(src_lob);
begin
select c into dest_lob from special
where a=id for update;
dbms_lob.fileopen(src_lob);
dbms_lob.loadfromfile(dest_lob,src_lob,amt);
dbms_lob.fileclose(Src_lob);
commit;
end;
/

SQL> @ blob_insert

Procedure created.

SQL> exec load(1);

PL/SQL procedure successfully completed.

SQL> select a from special;

       A
----------
       1
0
 
ipesinAuthor Commented:
Probably I didn't state my question correctly.... I need to load data from excel file into oracle table referencing directly to excel spreadsheet. I don;t want to use blob. How can I reference to each individual cell? For example,
I need to read file that has 4 columns - and I need to open this file and read each row and identify each cell within this row....
0
 
schwertnerCommented:
You can use the built-in "win_api_dialog.open_file" which will show you the open dialog box from which you can open any file required.

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now