Oracle uses the Oracle SQL Developer tool to access binary files such as images in BLOB fields

Source: Internet
Author: User

You can also use PL/SQL

CreateDirectory "image" as 'e:\';--"image" to bring double quotes, many online without, I test error, and, ' E:\ ' is the server directory, non-local directory. User Authorization required: Grant create any directory to username;Declareb_file bfile;     B_lob blob; begin     Insert  intoTB_SJ (SJBM,SJMC,RKSJ,XGSJ,GSBM,SJDATA,LBBM)Values(1,'Figure 2-1 C1SR sedimentary facies plan of ASA key area', Sysdate,sysdate,2, Empty_blob (),4)returnSjdata intoB_lob;--This table is the b_file built between me:=Bfilename ('Image','The drawings 2-1 the C1SR sedimentary facies plan of the ASA's key area. CDR');--tmp is the directory where the files are created, Filename.jpg is the file name, and the file is converted to the bfile typeDbms_lob.Open(b_file,dbms_lob.file_readonly);--Open B_file as read-onlyDbms_lob.loadfromfile (B_lob,b_file,dbms_lob.getlength (b_file));--convert content from B_file to B_lobDbms_lob.Close(B_file); Commit; End;

Oracle uses the Oracle SQL Developer tool to access binary files such as images in BLOB fields

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.