Access modes

The smart-large-object open mode includes an access mode, which determines which read and write operations are valid on the open smart large object.

The following table shows the access modes for a smart large object.
Table 1. Access modes for smart large objects
Access mode Purpose
Read-only mode Only read operations are valid on the data.
Dirty-read mode You can read uncommitted data pages for the smart large object. No locks are requested on the data. You cannot write to a smart large object after you set the mode to MI_LO_DIRTY_READ. When you set this flag, you reset the current transaction isolation mode to dirty read for this smart large object.
Write-only mode Only write operations are valid on the data.
Write/append mode Any data you write is appended to the end of the smart large object. By itself, it is equivalent to write-only mode followed by a seek to the end of the smart large object. Read operations fail.

When you open a smart large object in write/append mode only, the smart large object is opened in write-only mode. Seek operations move the seek position, but read operations to the smart large object fail, and the LO seek position remains unchanged from its position just before the write. Write operations occur at the LO seek position, and then the seek position is moved.

Read/write mode Both read and write operations are valid on the data.
Truncate Delete any existing data in the smart large object and move the LO seek position to the start of the smart large object (byte 0). If the smart large object does not contain data, this access mode has no effect.