Reads text and image values from the database, starting from a specified offset and reading a specified number of bytes. This feature is provided solely for compatibility with Transact-SQL and its use is not recommended.
READTEXT table-name.column-name text-pointer-offset text-size [ HOLDLOCK ]
READTEXT is used to read CHAR, NCHAR, and BINARY columns from a database. You cannot perform READTEXT operations on views.
You must be the owner or have SELECT privileges on the table, or have the SELECT ANY TABLE system privilege.
None.
Not in the standard.
The following Embedded SQL example uses TEXTPTR to locate the Description column associated with ProductID 500 in the MarketingInformation table.
The text pointer is stored in the variable txtptr and supplied as a parameter to the READTEXT statement which returns 55 bytes, starting at column offset 181.
EXEC SQL BEGIN DECLARE SECTION; char hostvar[100]; EXEC SQL END DECLARE SECTION; EXEC SQL create variable txtptr binary(16); EXEC SQL set txtptr = ( SELECT textptr(Description) FROM GROUPO.MarketingInformation WHERE ProductID = '500' ); EXEC SQL PREPARE S1 FROM 'READTEXT GROUPO.MarketingInformation.Description txtptr 181 55'; EXEC SQL EXECUTE S1 INTO :hostvar; printf( "hostvar: %s\n", hostvar );
READTEXT returns the following string.
Lightweight 100% organically grown cotton construction.