Access modes
When you open a smart large object, you specify the access mode for the data. The access mode determines which read and write operations are valid on the open smart large object.
The following table describes the access modes that ifx_lo_open() and ifx_lo_create() support.
Access mode | Purpose | Constant |
---|---|---|
Read only | Only read operations are valid on the data. | LO_RDONLY |
Dirty read | Lets you read uncommitted data pages for the smart
large object. You cannot write to a smart large object after you set
the mode to LO_DIRTY_READ. When you set this flag, you reset the current
transaction isolation mode to dirty read for this smart large object. Do not base updates on data that you obtain from a smart large object in dirty-read mode. |
LO_DIRTY_READ |
Write only | Only write operations are valid on the data. | LO_WRONLY |
Append | Intended for use with LO_WRONLY or LO_RDWR. Sets the location pointer to the end of the object immediately before each write. Appends any data you write to the end of the smart large object. If LO_APPEND is used alone, the object is opened for reading only. | LO_APPEND |
Read/write | Both read and write operations are valid on the data. | LO_RDWR |
Buffered access | Uses standard database server buffer pool. | LO_BUFFER |
Lightweight I/O | Uses private buffers from the session pool of the database server. | LO_NOBUFFER |
When you open a smart large object with LO_APPEND only, the database server opens the smart large object as read-only. Seek operations and read operations move the file pointer. Write operations fail and do not move the file pointer.
You can mask the LO_APPEND flag with another access mode. In any
of these OR combinations, the seek operation remains unaffected. The
following table shows the effect on the read and write operations
that each of the OR combinations has.
OR operation | Read operations | Write operations |
---|---|---|
LO_RDONLY | LO_APPEND | Occur at the file position and then move the file position to the end of the data that has been read. | Fail and do not move the file position. |
LO_WRONLY | LO_APPEND | Fail and do not move the file position. | Move the file position to the end of the smart large object and then write the data; file position is at the end of the data after the write. |
LO_RDWR | LO_APPEND | Occur at the file position and then move the file position to the end of the data that has been read. | Move the file position to the end of the smart large object and then write the data; file position is at the end of the data after the write. |