Categories:

Table functions

<service_name>!SPCS_CANCEL_JOB

Cancels a Snowpark Container Services job; also referred to as job service. When you cancel a job, Snowflake stops the job from running and removes the resources allocated for running the job.

See also:

Run a job service, Working with services

Syntax

<service_name>!SPCS_CANCEL_JOB();
Copy

Returns

Returns a string that indicates whether or not the job was canceled.

Access control requirements

A role used to execute this operation must have the following privileges at a minimum:

Privilege

Object

Notes

OPERATE

Service

To cancel the job service, you must use a role that was granted this privilege.

The USAGE privilege on the parent database and schema are required to perform operations on any object in a schema.

For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.

For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

Examples

Cancel the my_job job.

SELECT my_job!SPCS_CANCEL_JOB();
Copy
Language: English