SQLTABLE

此説明頁面適用於 Studio。 此資訊亦適用於 Desktop Studio。

Icon of SQLTable: gray database with code brackets

向資料庫伺服器提交 SQL(結構化查詢語言)陳述式並返回多列結果。 將 SQL(結構化查詢語言)陳述式提交至資料庫伺服器,並傳回多列結果。 此動作根據與您的帳戶關聯的後端伺服器的位置(而不是 UTC 時區)返回時間/日期。 您可以使用Snippet 動作將此時間/日期轉換為另一個時區。

 

相依性

  • 使用 SETDB 動作選擇您要在其中進行查詢的 DB Connector 群組。 如未使用Setdb,則會使用預設的 NiCE CXone 資料庫。 此資料庫是提供給所有客戶的表的通用字典。

  • 此動作將所有列作為陣列返回。
  • 使用 Sqltable,其用途與 動作相同,適用於預期會有多個列的情況。 與 Sqlselect 動作一樣,欄值儲存在與欄名稱同名的變數中。 然而,在此動作中,每個欄變數可以儲存多於一筆記錄。 每條記錄都由 RowSeparator 屬性中定義的字元分隔。 如果使用預設豎線符號 (|),則每一欄都可以作為陣列引用。
  • 當您不對資料進行明確排序時,SQL 資料庫不保證任何類型的排序。
  • 注意不要選擇大量資料。 這最終會導致指令碼失敗。 如需順序存取大型表格,請參閱Sqlcursor 動作。

支援的程式碼類型

一個正方形,其上有一條通往其他三個正方形的分支線。

Icon of gray-green envelope

深綠色語音氣泡圖示

Icon of purple telephone handset

鏽色留言符號圖示,由兩個以線條相連的圓形組成

Icon of pink document with lines of text

Icon of green mobile phone with a speech bubble on its screen

通用

電郵 聊天 電話 語音郵件 工作項目 SMS

屬性

屬性

描述

新增標題

Enter a short phrase that uniquely identifies this action in the script. The caption appears on the script canvas under the action icon.

SQL 查詢

要提交給資料庫伺服器的 SQL 陳述式。 此陳述式應返回記錄。

行分隔符

用於分隔單個記錄的分隔字元。

欄位計數變數

將返回 SQL 查詢返回的欄位數的變數的名稱。

行計數變數

將返回 SQL 查詢返回的列數的變數的名稱。 所建立的 Row Count Var 搭配 Loop 動作非常有用,可用於決定您想要重複序列的次數。

全域變數

未使用。
發佈 發布變數和值,以及與聯絡人關聯的資料庫中的所有內容。 如果您想發佈特定資料,請使用Assign 動作。

最大行數

要檢索的最多列數。 預設值為 100。

逾時秒數

查詢逾時之前的秒數。 預設值為 10。 支援的最大秒數為 30(儘管實際上可以在欄位中輸入更大的數字)。

分支

條件

描述

預設

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.當資料未從資料庫返回時會發生這種情況。
錯誤 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. 當 SQL 查詢無效時發生這種情況。
逾時 Path taken if there is no response for the number of seconds specified.