Sqltable

向数据库服务器提交 SQL(结构化查询语言)语句,并返回多行结果。此操作会根据与您的帐户相关联的后端服务器的位置返回一个时间/日期(而不是 UTC 时区)。您可以使用 Snippet action 将该时间/日期转换为另一个时区。

 

Dependencies

  • 此操作以数组形式返回所有行。
  • 当需要多行时,使用 Sqltable 可实现与 action 相同的效果。与 Sqlselect 操作一样,列值会存储在与列名同名的变量中。但是,在此操作中,每个列变量中都可能会存储多条记录。每条记录都由 RowSeparator 属性中定义的字符分隔。如果使用默认的竖线符号 (|),则每一列都可以作为一个数组引用。
  • 当您没有对数据进行显式排序时,SQL 数据库不会保证任何类型的排序。
  • 请注意,不要选择大量数据。否则,最终会导致脚本失败。如果需要顺序访问大型表格,请参阅 Sqlcursor action

Supported Script Types

The icon for a Generic script type - a rectangle with < and > symbols inside it.

The icon for the Email script type - a large @ symbol in a diamond.

The icon for the Chat script type - a chat bubble with an ellipsis inside (...), in a diamond shape.

The icon for the Phone script type - an old-style phone handset with curved lines indicating sound coming out of it.

The icon for the Voicemail script type - a symbol that looks like a cassette tape - two circles sitting on a horizontal line.

The icon for the Work Item script type-a piece of paper with one corner folded down and a bullet list on it.

The icon for the SMS script type - a smart phone with a chat bubble coming out of it.

The icon for the Digital script type - a computer monitor with a smartphone next to it.

通用

电子邮件 聊天 电话 语音信箱 工作项目 短信 数字

Properties

属性

说明

说明文字

输入在脚本中唯一标识此操作的短语。标题显示在脚本画布上的操作图标下方。The default is the action name.

SQLQuery

将提交到数据库服务器的 SQL 语句。此语句应返回记录。

RowSeparator

用于分隔各条记录的分隔符字符。

FieldCountVar

将返回 SQL 查询所返回的字段数的变量的名称。

RowCountVar

将返回 SQL 查询所返回的行数的变量的名称。创建的行计数变量非常有助于 Loop action 确定要重复序列的次数。

GlobalVariables

未使用。
Publish 发布变量和值,以及数据库中与联系人相关联的所有内容。如果要发布特定数据,请使用 Assign action

MaxRows

要检索的行的最大数量。默认为 100

TimeoutSec

查询超时之前的秒数。默认为 10。支持的最大秒数为 30(尽管实际上可以在字段中输入更大的数字)。

分支

条件

说明

Default

除了脚本满足条件要求其接受其他分支的情况之外,所要采用的路径。如果未定义操作的其他分支,也会执行此操作。
NoRecords 指定的属性没有值时所采用的路径。 如果数据未从数据库返回,则会发生这种情况。
Error 操作无法正确执行时所采用的路径。例如,出现连接不良、语法错误等意外问题时。_ERR 变量以单个下划线字符填充,应包含对问题的简要解释。 如果 SQL 查询无效,则会发生这种情况。
Timeout 在指定的秒数内没有响应时所采用的路径。