Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 13-06-2009
Member
 
Join Date: May 2008
Posts: 260
Insertion of clean Excel data into oracle table using html

I have created a form using HTML. Now i have to browse excel sheet and on click of submit button i want excel data to be submitted in oracle table through procedure.

Its very urgent.

Please help me out.
Reply With Quote
  #2  
Old 13-06-2009
Member
 
Join Date: May 2008
Posts: 194
Re: Insertion of clean Excel data into oracle table using html

you can call this ddl in dynamic sql to create a external table.

Code:
CREATE TABLE EMP_ext 
( 
EMPNO NUMBER (4), 
ENAME VARCHAR2 (10 BYTE), 
JOB VARCHAR2 (9 BYTE), 
MGR NUMBER (4), 
HIREDATE DATE, 
SAL NUMBER (7,2), 
COMM NUMBER (7,2), 
DEPTNO NUMBER (2), 
MERGE VARCHAR2 (50 BYTE) 
) 
ORGANIZATION EXTERNAL ( 
TYPE ORACLE_LOADER 
DEFAULT DIRECTORY XML_DIR 
ACCESS PARAMETERS ( 
RECORDS DELIMITED BY NEWLINE 
FIELDS TERMINATED BY ',' 
MISSING FIELD VALUES ARE NULL 
) 
LOCATION ( 'emp.txt') 
) 
PARALLEL 5 
REJECT LIMIT UNLIMITED;
Reply With Quote
  #3  
Old 13-06-2009
Member
 
Join Date: May 2008
Posts: 376
Re: Insertion of clean Excel data into oracle table using html

Or You can use the following code to do that data loading. Of course with some modifications.

Code:
/ * Formatted on 2008/05/14 13:43 (Formatter Plus v4.8.7) * / 
DECLARE 
f UTL_FILE.file_type; 
s VARCHAR2 (200); 
l LONG: =''; 
i NUMBER (3): = 0; 
BEGIN 
f: = UTL_FILE.fopen ( 'XML_DIR', 'emp.txt', 'R'); 
WHILE (TRUE) 
LOOP 
UTL_FILE.get_line (f, s); 
DBMS_OUTPUT.put_line (s); 
i: = i + 1; 
l: = l | | s; 
END LOOP; 
EXCEPTION 
WHEN NO_DATA_FOUND 
THEN 
DBMS_OUTPUT.put_line ('================ END OF FILE ================'); 
DBMS_OUTPUT.put_line ( '** NO OF LINES:' | | i); 
DBMS_OUTPUT.put_line (l); 
UTL_FILE.fclose (f); 
INSERT INTO chk_long VALUES (l); 
WHEN OTHERS 
THEN 
DBMS_OUTPUT.put_line 
('================ SOME ERROR OCCURED ==============='); 
UTL_FILE.fclose (f); 
END;
Reply With Quote
  #4  
Old 13-06-2009
Member
 
Join Date: May 2008
Posts: 390
Re: Insertion of clean Excel data into oracle table using html

"form using HTML" implies a client front end.
"excel data" implies excel file which is Microsoft proprietary data format (binary data).
"submitted in oracle table" implies excel data on client has to get from client to database server.

Hint: you will need some java that is written to access files on the client through the web browser (which then reads the binary file and uploads it to a BLOB in a table on the database).

If this is not your requirement you need to be more clear.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Insertion of clean Excel data into oracle table using html"
Thread Thread Starter Forum Replies Last Post
Convert Excel data to HTML Table Chalina Software Development 2 04-08-2009 11:21 PM
need to show data in other html table for php Quattro Software Development 3 02-07-2009 11:44 PM
Create html table from excel file Laler Windows Software 3 26-06-2009 08:44 AM
Export data from excel spreadsheet to an Oracle Table Kurtz Windows Software 2 13-05-2009 01:11 PM
Importing HTML table in a Spreadsheet - Excel 2007 Aarif Tips & Tweaks 1 01-12-2008 02:35 PM


All times are GMT +5.5. The time now is 05:09 PM.