sql - Inserting Image Into BLOB Oracle 10g -


I am trying to insert an image into a label field in a signature, which I will then select from the table. And a report. I can not understand how to get an image in the table. I had included one, but when I rendered the image only, it was shown on the report, not the image itself

Table

  Create table esignatures (no office number (6,0), user name VARCHAR2 (10) No, zero, ebb INSERT statement (SQL)   
  Insert properties in INSERT (100, 'BOB', utl_raw) Cast_to_raw () 'C: \ photos \ image1.png'));  

I know that I am inserting the string position as hex value, how can I get the image hex value in the table, so when I render I would see Dingi image is visible.

You can not access a local directory from pl / sql. If you use bfile, you can set a directory () on the server where the oracle is running where you have to insert your images

If you have a handful of pictures from your local machine If you want to insert, you will need a client side app to do this. You can write your own, but usually I use Tod for this. In Schema browser, click on the table, click on the Data tab, and press the + sign to add a line, double click on the Blob column, and a wizard opens. The far left icon will load an image in Blob:

Enter image details here < / P>

SQL is a common feature of the developer. See the "Load" link below:

Enter image details here

< P> If you need to draw a picture on the wire, then you can use it pl / sql, but this is not straight forward. First, you will need to setup ACL list access (for security reasons) to pull the wire. See more about ACL setup.

ACL is complete assuming that you will drag the image like this:

  declare l_url varchar2 (4000): = 'http: //www.oracleimg .com / us / assets / 12_c_navbnr.jpg '; L_http_request UTL_HTTP.req; L_http_response UTL_HTTP.resp; LORO RAW (2000); L_blob BLOB; Start - Important: Setup ACL Access List First! DBMS_LOB.createtemporary (l_blob, FALSE); L_http_request: = UTL_HTTP.begin_request (l_url); L_http_response: = UTL_HTTP.get_response (l_http_request); - Copy the response to the blob BEGIN loop UTL_HTTP.read_raw (l_http_response, l_raw, 2000); DBMS_LOB.writeappend (l_blob, UTL_RAW.length (l_raw), l_raw); End loop; Exception when UTL_HTTP.end_of_body then UTL_HTTP.end_response (l_http_response); End; Insert in my_pics (pic_id, pic) value (102, l_blob); Committed; DBMS_LOB.freetemporary (l_blob); End;  

Hope that helps.


Comments