SQLSELECT

此帮助页面适用于 Studio。 此信息也适用于 Desktop Studio。

Icon of SQLSelect: gray database with code brackets

向数据库服务器提交 SQL(结构化查询语言)语句,并返回一个结果。

依赖关系

  • 当需要多个行结果时,请使用 Sqlcursor 操作。
  • 查询通常会返回一个或多个数据列。 当 NiCE CXone 将数据从数据库服务器返回给脚本时,每个单独的列都会存储在一个具有相同名称的变量中。
  • 您需要确定您希望与数据库提供程序建立标准连接、加密连接还是 VPN 连接。
  • 使用 SETDB 操作来选择您要在其中进行查詢的 DB Connector 组。 如果不使用 Setdb,则使用默认的 NiCE CXone 数据库。 该数据库是向所有客户提供的表格的通用字典。

支持的脚本类型

其中一条分支线通向其他三个正方形的正方形。

Icon of gray-green envelope

深绿色对话气泡图标

Icon of purple telephone handset

Icon of rust-colored voicemail symbol of two circles joined by a line

Icon of pink document with lines of text

绿色手机图标,屏幕上有一个语音气泡

通用

Email 聊天 电话 語音邮件 工作项目 短信

输入属性

这些属性定义操作在执行时使用的数据。

属性

说明

添加说明文字

输入在脚本中唯一标识此操作的短语。 标题显示在脚本画布上的操作图标下方。

SQL 查询

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

全局变量

未使用。
发布

发布变量和值。

此属性会发布与联系人相关联的数据库中的所有内容。

如果您想要发布特定数据,请使用 Assign 操作。

超时秒数

该操作在超时之前等待执行的秒数。该值必须介于 0 和 60 之间。

结果分支条件

结果分支条件允许您在脚本中创建分支,以在执行操作时处理不同的结果。

条件

说明

默认

Path taken unless the script meets a condition that requires it to take one of the other branches. It is also taken if the action's other branches are not defined.
NoRecords Path taken if there are no values for the specified properties. 如果数据未从数据库返回,则会发生这种情况。
OnError Path taken when the action fails to execute properly. For example, when there is an unexpected problem such as poor connectivity, syntax errors, and so on. The _ERR variable, with a single underscore character, should be populated with a condensed explanation of the problem.
OnTimeout Path taken if there is no response for the number of seconds specified.

脚本示例

这是一个示例,说明如何在脚本中使用此操作。 它并不是一个完整的脚本。 可能还需要编写其他脚本。

此示例脚本显示了正在使用的 SQL SELECT 操作。

使用 SQL SELECT 操作的示例脚本

下载此脚本。