DECLARE CURSOR (BLOB)

From InterBase

Go Up to Statement and Function Reference (Language Reference Guide)


Declares a Blob cursor for read or insert. Available in gpre.

DECLARE cursor CURSOR FOR 
{READ BLOB column FROM table 
| INSERT BLOB column INTO table}
[FILTER [FROM subtype] TO subtype]
[MAXIMUM_SEGMENT length];
Argument Description

<cursor>

Name for the Blob cursor

<column>

Name of the Blob column

<table>

Table name

READ BLOB

Declares a read operation on the Blob

INSERT BLOB

Declares a write operation on the Blob

[FILTER[FROM <subtype>] TO <subtype>]

Specifies optional Blob filters used to translate a Blob from one user-specified format to another; <subtype> determines which filters are used for translation

MAXIMUM_SEGMENT <length>

Length of the local variable to receive the Blob data after a FETCH operation

Description: Declares a cursor for reading or inserting Blob data. A Blob cursor can be associated with only one Blob column.

To read partial Blob segments when a host-language variable is smaller than the segment length of a Blob, declare the Blob cursor with the ­MAXIMUM_SEGMENT clause. If length is less than the Blob segment, FETCH returns length bytes. If the same or greater, it returns a full segment (the default).

Examples: The following embedded SQL statement declares a READ BLOB cursor and uses the ­MAXIMUM_SEGMENT option:

EXEC SQL
DECLARE BC CURSOR FOR
READ BLOB JOB_REQUIREMENT FROM JOB MAXIMUM_SEGMENT 40;

The next embedded SQL statement declares an INSERT BLOB cursor:

EXEC SQL
DECLARE BC CURSOR FOR
INSERT BLOB JOB_REQUIREMENt INTO JOB;

See Also

Advance To: