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.

一般

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

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 在指定的秒數內沒有回應時採用的路徑。