• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Store word documents as blobs using base 64 encoding

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
It would be helpful if you could help me with this issue.

I need to write sql scripts using base64 encoding to store a word document as blobs in the oracle database. i need to store the word documents as a one shot update using only scripts.. i havent worked on stored procedures as such.. and it would be nice if anyone can give me pointers as to how to start this approach..

thanks
Suman
 
Ranch Hand
Posts: 182
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi maruthan,

Why do you use Base64 encoding since you are already storing file in a BLOB? It will increase the size of data and will bring extra cost of encode/decode operations. If you are not in a special need for Base64 encoded data just store the data as BLOB. You can follow this guide from Oracle site.
 
maruthan nagalingam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Thanks for your reply.. But my requirement is jus to create procedures or scripts that will insert all the word documents(.docx) as blobs into the database at one shot initially. I am aware that it could be done in the java side.. but my aim is to create scripts to store the .docx file as blobs..After storing it as blobs i need to read the blob ,convert the blobs into docx4j supporting format to open the word document in the web browser. Thats the reason i need to go for base64 encoding. Can you please provide me some approach regarding this.

thanks
 
Fatih Keles
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Assuming that you are doing this in Oracle environment, here stackoverflow guys explain how to load a file into a blob with pl/sql. You may find many other sample code, just google it.

For base64 conversion oracle database has a built-in utl_encode package. I hope this will give you a head start.

Regards,
Fatih.
 
maruthan nagalingam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Fatih,

Thank you so much for the initial approch to start with.. will go through the pointers and keep you informed..

thanks once again..

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic