Endpoint Delete Attachment
Name
delete_attachment
Description
Delete an attachment by its sys_id. [API reference]
Parameters
| Parameter | Required | Options |
|---|---|---|
|
Name:
Label: Attachment Id (i.e. sys_id) Sys ID of the attachment to delete |
YES |
Output Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description |
|---|---|---|---|---|
| status |
DT_WSTR
|
nvarchar(10)
|
10 | |
| sys_id |
DT_WSTR
|
nvarchar(32)
|
32 | |
| http_status |
DT_I4
|
int
|
Input Columns
| Label | Data Type (SSIS) | Data Type (SQL) | Length | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| There are no Static columns defined for this endpoint. This endpoint detects columns dynamically at runtime. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Examples
SSIS
Use ServiceNow Connector in API Source or in API Destination SSIS Data Flow components to read or write data.
API Source
| Required Parameters | |
|---|---|
| Attachment Id (i.e. sys_id) | Fill-in the parameter... |
| Optional Parameters | |
| RawOutputDataRowTemplate | {} |
| EnableRawOutputModeSingleRow | True |
| ContinueOn404Error | |
API Destination
| Required Parameters | |
|---|---|
| Attachment Id (i.e. sys_id) | Fill-in the parameter... |
| Optional Parameters | |
| RawOutputDataRowTemplate | {} |
| EnableRawOutputModeSingleRow | True |
| ContinueOn404Error | |
ODBC application
Use these SQL queries in your ODBC application data source:
Delete an attachment
<p>Delete a single attachment by its <code>sys_id</code>. <strong>SysId</strong> is the attachment's id in the <code>sys_attachment</code> table. Provide the <code>TableName</code> (optional for clarity) and the attachment <code>SysId</code>.</p>
-- Delete a single attachment by attachment sys_id
SELECT * FROM delete_attachment
WITH(
TableName='problem', -- optional, used for context
SysId='d871411783d6321032ddb9f6feaad339'
)
SQL Server
Use these SQL queries in SQL Server after you create a data source in Data Gateway:
Delete an attachment
<p>Delete a single attachment by its <code>sys_id</code>. <strong>SysId</strong> is the attachment's id in the <code>sys_attachment</code> table. Provide the <code>TableName</code> (optional for clarity) and the attachment <code>SysId</code>.</p>
DECLARE @MyQuery NVARCHAR(MAX) = '-- Delete a single attachment by attachment sys_id
SELECT * FROM delete_attachment
WITH(
TableName=''problem'', -- optional, used for context
SysId=''d871411783d6321032ddb9f6feaad339''
)';
EXEC (@MyQuery) AT [LS_TO_SERVICENOW_IN_GATEWAY];