Reads text and image values, starting from a specified offset and reading a specified number of bytes.
READTEXT [[database.]owner.]table_name.column_name
text_ptr offset size [HOLDLOCK]
where
READTEXT is used with a text_ptr. The value of text_ptr can be obtained using the TEXTPTR function. The TEXTPTR function returns a pointer to the text or image column in the specified row or to the text or image column in the last row returned by the query if more than one row is returned. Since the TEXTPTR function returns a 16-byte binary string, it is best to declare a local variable to hold the text pointer and then use the variable with READTEXT.
The value in the global variable @@TEXTSIZE, which is the limit on the number of bytes of data to be returned, supersedes the size specified for READTEXT if it is less than the specified size for READTEXT. For details on how to set the session setting for TEXTSIZE, see the SET statement.
Users must have SELECT permission on the table to use READTEXT. READTEXT permission is transferred when SELECT permission is transferred.