Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
返回一个指向指定列的 16 字节二进制指针。提供此功能只是为了与 Transact-SQL 兼容,但不建议使用此功能。
TEXTPTR( column-name )
column-name 包含 CHAR、NCHAR 或 BINARY 数据的列的名称。
BINARY
包括此函数是为了与 Transact-SQL 兼容。
SQL/2008 服务商扩充。
下列嵌入式 SQL 示例使用 TEXTPTR 在 MarketingInformation 表中查找与 ProductID 500 关联的 Description 列。
文本指针存储在变量 txtptr 中并作为参数提供给 READTEXT 语句,该语句返回从列偏移 181 开始的 55 个字节。
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 返回以下字符串。
Lightweight 100% organically grown cotton construction.