10.12.2012 Views

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Blob Class<br />

Blob Class<br />

The Blob class defines the common properties of objects of type BLOB. A BLOB is a<br />

large binary object stored as a column value in a row of a database table. A Blob<br />

object contains a logical pointer to a BLOB, not the BLOB itself.<br />

Methods of the Blob class enable you to perform specific tasks related to Blob<br />

objects.<br />

Methods of the ResultSet and Statement classes, such as getBlob() and<br />

setBlob(), enable you to access an SQL BLOB value.<br />

To create a null Blob object, use the syntax:<br />

Blob();<br />

The only methods valid on a null Blob object are setNull(), isNull(), and<br />

operator=().<br />

To create an uninitialized Blob object, use the syntax:<br />

Blob(const Connection *connectionp);<br />

An uninitialized Blob object can be initialized by:<br />

■ The setEmpty() method. The BLOB can then be modified by inserting this<br />

BLOB into the table and then retrieving it using SELECT ... FOR UPDATE. The<br />

write() method will modify the BLOB; however, the modified data will be<br />

flushed to the table only when the transaction is committed. Note that an<br />

update is not required.<br />

■ Assigning an initialized Blob object to it.<br />

To create a copy of a Blob object, use the syntax:<br />

Blob(const Blob &srcBlob);<br />

Summary of Blob Methods<br />

Table 8–3 Blob Methods<br />

Method Summary<br />

append() on page 8-13 Append a specified BLOB to the end of the current<br />

BLOB.<br />

8-12 <strong>Oracle</strong> <strong>C++</strong> <strong>Call</strong> <strong>Interface</strong> Programmer’s <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!