Categories:

Notification functions (Message Construction)

APPLICATION_JSON

Returns a JSON object that specifies the JSON message to use for a notification. This is a helper function that you use to construct a message object for the SYSTEM$SEND_SNOWFLAKE_NOTIFICATION stored procedure.

See also:

Using SYSTEM$SEND_SNOWFLAKE_NOTIFICATION to send notifications , SYSTEM$SEND_SNOWFLAKE_NOTIFICATION , TEXT_HTML , TEXT_PLAIN

语法

SNOWFLAKE.NOTIFICATION.APPLICATION_JSON( '<message>' )

实参

'message'

要发送的消息的内容。

您不需要为消息中的字符串转义双引号(例如,键和值的双引号)。该函数会为您转义这些双引号。

返回

A JSON-formatted string that specifies a message for the SYSTEM$SEND_SNOWFLAKE_NOTIFICATION stored procedure to send.

例如,假设您调用该函数,并传入一条 JSON 消息:

SELECT SNOWFLAKE.NOTIFICATION.APPLICATION_JSON('{"data": "hello world"}');

该函数会返回以下 JSON 格式的字符串:

'{"application/json":"{\"data\": \"hello world\"}"}'

请注意该函数是如何转义消息中键和值的双引号的。

示例

See Using SYSTEM$SEND_SNOWFLAKE_NOTIFICATION to send notifications.