Home » Developer & Programmer » Forms » Read data from excel and store it in blob
Read data from excel and store it in blob [message #470622] Tue, 10 August 2010 06:07 Go to next message
akilaa
Messages: 7
Registered: August 2010
Location: Chennai
Junior Member
Hi,

I am getting the file using CLIENT_GET_FILE_NAME. I need to read the data from the .xsl file and convert it into blob. The file should not be stored in DB.

Please help me by providing suggestions / solutions.

Thanks.

[Updated on: Tue, 10 August 2010 06:15]

Report message to a moderator

Re: Read data from excel and store it in blob [message #470657 is a reply to message #470622] Tue, 10 August 2010 06:59 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Store the file.
What exactly do you think you can read out of an xls to store in a blob?
Re: Read data from excel and store it in blob [message #470662 is a reply to message #470657] Tue, 10 August 2010 07:05 Go to previous messageGo to next message
akilaa
Messages: 7
Registered: August 2010
Location: Chennai
Junior Member
Am using

l_attached_file BLOB ;
..
DBMS_LOB.createtemporary(l_attached_file, TRUE);
DBMS_LOB.open(l_attached_file,Lob_Readwrite);
file_handle := CLIENT_TEXT_IO.FOPEN(file_path,'R');


loop
CLIENT_TEXT_IO.GET_LINE(file_handle,newline);
DBMS_LOB.writeappend(l_attached_file,length(newline),UTL_RAW.CAST_TO_RAW(newline));


end loop;

i ll pass l_attached_file in my mail ,xls file is attaching but with unrecogonised content.

this code is working for reading txt file , but its not working for .xls and .doc .

Please provide the suggestions for reading xls files.

Re: Read data from excel and store it in blob [message #470671 is a reply to message #470662] Tue, 10 August 2010 07:22 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
You can't read binary files in chunks like that.
If you're trying to email it you need to attach the file as a whole. No other approach will work.
Re: Read data from excel and store it in blob [message #470675 is a reply to message #470671] Tue, 10 August 2010 07:48 Go to previous messageGo to next message
akilaa
Messages: 7
Registered: August 2010
Location: Chennai
Junior Member
Thank you.
I am passing the attachment as a blob in my mail.
Is there any way to get the entire file and store as blob, so that i can use that blob in my code.
Re: Read data from excel and store it in blob [message #470693 is a reply to message #470675] Tue, 10 August 2010 08:36 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Seach this site for email attachment. You'll find examples.
Re: Read data from excel and store it in blob [message #470695 is a reply to message #470693] Tue, 10 August 2010 08:38 Go to previous messageGo to next message
akilaa
Messages: 7
Registered: August 2010
Location: Chennai
Junior Member
please provide the site.
Re: Read data from excel and store it in blob [message #470697 is a reply to message #470695] Tue, 10 August 2010 08:48 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
This site. orafaq.
There's a search link at the top of the page.
Re: Read data from excel and store it in blob [message #470701 is a reply to message #470697] Tue, 10 August 2010 08:51 Go to previous message
akilaa
Messages: 7
Registered: August 2010
Location: Chennai
Junior Member
ok.thank you.
Previous Topic: Populate Record in List Item
Next Topic: Treeview with images and checkboxes in forms with OLE-Container
Goto Forum:
  


Current Time: Thu Sep 19 11:09:34 CDT 2024