KMK.SQLCMD


Syntax

KMK.SQLCMD "SQL statement" {NO-MESSAGE}

Description

KMK.SQLCMD is a Kourier Service command that executes a standard SQL statement.  If used without the NO-MESSAGE keyword, the output of the SQL command is captured into a Kourier message and sent to the target DSN.  If used with the NO-MESSAGE keyword, the SQL command is executed but no message is sent to the target DSN.

Options

NO-MESSAGE

Indicates that the output of the SQL statement should NOT be captured and sent to the target DSN.

Scope of Use

This command MUST be used in a Kourier Service and it MUST be the first command in the service.

Examples

[{"id":"1f4790e62ea66e1598e68f4188028eb5","title":"Example 1"},{"id":"88a4c2787d033a2448ccfe54b49f4278","title":"Example 2"}]
top

KMK.SQLCMD "SELECT TOP 10 * FROM KOURIER_RUNLOG" USING TSQL_WAHOO EXPORT-FORMAT "PIPE"

In this example, the SQL statement returns the first 10 rows from the KOURIER_RUNLOG table. The output of this command can be sent to any target DSN, such as a directory on the sales intranet website. 

KMK.SQLCMD "exec SP_WHO" USING TSQL_WAHOO EXPORT-FORMAT "PIPE"

In this example, the SQL Stored Procedure SP_WHO is executed.  The output of this command can be sent to any target DSN, such as a directory on the sales intranet website.