If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > doubt

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-09-11, 08:22
Naina27 Naina27 is offline
Registered User
 
Join Date: Dec 2011
Posts: 7
doubt

how to extract xml file from unix and store(or insert ) in a clob column

please reply!!!!
Reply With Quote
  #2 (permalink)  
Old 12-09-11, 08:23
Naina27 Naina27 is offline
Registered User
 
Join Date: Dec 2011
Posts: 7
guys anyone plz help !!
Reply With Quote
  #3 (permalink)  
Old 12-09-11, 10:10
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 6,416
XML file must reside on DB Server system
__________________
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Reply With Quote
  #4 (permalink)  
Old 12-09-11, 10:56
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,408
Quote:
Originally Posted by Naina27 View Post
how to extract xml file from unix and store(or insert ) in a clob column
Which SQL client are you using?
Reply With Quote
  #5 (permalink)  
Old 12-10-11, 13:22
The_Duck The_Duck is offline
Registered User
 
Join Date: Jul 2003
Posts: 2,292
use XMLtype CLOB column can load using an external table
__________________
- The_Duck
you can lead someone to something but they will never learn anything ...
Reply With Quote
  #6 (permalink)  
Old 12-15-11, 02:31
Naina27 Naina27 is offline
Registered User
 
Join Date: Dec 2011
Posts: 7
Thumbs up

hey guys i have found the solution,,, many thanks for ur reply,, but it worked in a very different way from all ur suggestions..
Neways my wrk was done n the code is wrkin fine,,,
Reply With Quote
  #7 (permalink)  
Old 12-15-11, 10:32
cis_groupie cis_groupie is offline
Registered User
 
Join Date: Jun 2004
Posts: 597
Quote:
Originally Posted by Naina27 View Post
hey guys i have found the solution,,, many thanks for ur reply,, but it worked in a very different way from all ur suggestions..
Neways my wrk was done n the code is wrkin fine,,,
unlike your spellchecker
__________________
90% of users' problems can be resolved by punching them - the other 10% by switching off their PCs.
Reply With Quote
  #8 (permalink)  
Old 12-15-11, 10:54
beilstwh beilstwh is offline
Lead Application Develope
 
Join Date: Jun 2004
Location: Liverpool, NY USA
Posts: 2,222
If you have a solution then post it for the use of other people.
__________________
Bill
You do not need a parachute to skydive. You only need a parachute to skydive twice.
Reply With Quote
  #9 (permalink)  
Old 02-15-12, 04:34
Naina27 Naina27 is offline
Registered User
 
Join Date: Dec 2011
Posts: 7
doubt solution

CREATE OR REPLACE PROCEDURE load_clob_data AS
var_file_handle utl_file.file_type;
file_location VARCHAR2(100);
text VARCHAR2(5676);
var_clob CLOB;
BEGIN
file_location := '/ebz/apps/angol';
var_file_handle := utl_file.fopen(file_location, 'test.xml', 'r');
LOOP
BEGIN
utl_file.get_line(var_file_handle, text);
DBMS_OUTPUT.put_line(text);
EXCEPTION
WHEN NO_DATA_FOUND THEN
EXIT;
END;
var_clob := var_clob ||text || CHR(13);
END LOOP;
INSERT INTO clob_tab(datetime_inserted,datetime_start,data) VALUES(to_date('12/12/2011 13:11:15','dd/mm/yyyy hh24:mi:ss'),to_date('12/12/2011 13:10:10','dd/mm/yyyy hh24:mi:ss'),var_clob);
commit;
utl_file.fclose(var_file_handle);
END;
/
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On