INSERT CURSOR (BLOB)
Go Up to Statement and Function Reference (Language Reference Guide)
Inserts data into a Blob cursor in units of a Blob segment-length or less in size. Available in gpre
.
INSERT CURSOR cursor
VALUES (:buffer [INDICATOR] :bufferlen);
Argument | Description |
---|---|
<cursor> |
Name of the Blob cursor |
|
Clause containing the name and length of the buffer variable to insert |
|
Name of host-variable buffer containing information to insert |
|
Indicates that the length of data placed in the buffer follows |
|
Length, in bytes, of the buffer to insert |
Description: INSERT CURSOR
writes Blob data into a column. Data is written in units equal to or less than the segment size for the Blob. Before inserting data into a Blob cursor:
- Declare a local variable, <buffer>, to contain the data to be inserted.
- Declare the length of the variable, <bufferlen>.
- Declare a Blob cursor for
INSERT
and open it.
Each INSERT
into the Blob column inserts the current contents of <buffer>. Between statements fill <buffer> with new data. Repeat the INSERT
until each existing <buffer> is inserted into the Blob.
INSERT CURSOR
requires the INSERT
privilege, a table privilege controlled by the GRANT
and REVOKE
statements.Example: The following embedded SQL statement shows an insert into the Blob cursor:
EXEC SQL
INSERT CURSOR BC VALUES (:line INDICATOR :len);