Oracle defines a BLOB field for storing binary data, but this field does not hold true binary data, can only Gencun a pointer to the word, and then places the data in the LOB segment of Oracle to which the pointer points, and the LOB segment is part of the database's internal table.
Therefore, before manipulating an Oracle blob, the pointer (the locator) must be obtained before the BLOB data can be read and written.
How do I get a blob pointer in a table? You can use the INSERT statement to insert an empty blob into the table (call Oracle's function Empty_blob ()), which creates a pointer to the BLOB, and then queries the pointer for the empty BLOB so that you can get the Blob object. To read and write BLOB data.
Insert an empty BLOB insert into Test (id,image) http://www.aliyun.com/zixun/aggregation/9541.html ">values (?, Empty_blob ()); Cursor Select image from Test where id= to get a blob? for update; Blob B = Rs.getblob ("image") Note: You must add a for update to lock the row until the row has been modified to ensure no concurrency conflict.
Use IO, and get cursor to read and write data to the database note: The above operations need to open the transaction.
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.