Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (中文) » SQL Anywhere 服务器 - SQL 参考 » 系统对象 » 系统过程 » 按字母顺排序的系统过程列表

 

xp_scanf 系统过程

从输入字符串和格式字符串中抽取子串。

语法
xp_scanf(
  input_buffer,
  format,
  parm [, parm2, ... ]
)
参数
  • input_buffer   使用此 CHAR(254) 参数指定输入字符串。

  • format   使用此 CHAR(254) 参数指定输入字符串的格式,为每个 parm 参数使用占位符 (%s)。format 参数中最多可以有五十个占位符,而且必须与 parm 参数中的占位符数量相同。

  • parm   使用这些 CHAR(254) 参数中的一个或多个来指定从 input_buffer 中抽取的子字符串。最多可以有 50 个这样的参数。

注释

xp_scanf 系统过程使用指定的 format 从输入字符串中抽取子字符串,并将结果放在指定的 parm 值中。

权限

另请参见
示例

以下语句从输入缓冲区 Hello World! 中抽取子字符串 Hello 和 World!,并将它们分别放在变量 string1 和 string2 中,然后再选择它们:

CREATE VARIABLE string1 CHAR(254);
CREATE VARIABLE string2 CHAR(254);
CALL xp_scanf( 'Hello World!', '%s %s', string1, string2 );
SELECT string1, string2;