SLAM_download_job
In case of client disconnection, Speediful can re-download bulk jobs that it submitted. This process will not work with jobs submitted by other applications or clients. This can be considered a kind of 'rescue' operation if something goes awry on the client machine.
For bulk query jobs, the response will be downloaded to the destination table specified in @table.
For Bulk v1 load jobs, set @table to the name of the input table from the originating load operation otherwise the operation will fail. The Id and SLAM_message columns will be updated
For Bulk v2 load jobs, three tables will be created based on the @table parameter to store the result of the job:
- <table_name>_successful
- <table_name>_failed
- <table_name>_unprocessed
These can be manually correlated back to the input table via the External Id
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
@job_id | NVARCHAR | Required | Salesforce bulk job ID to download results for (either 15 or 18-character id) |
@table | NVARCHAR | Required | For bulk query jobs: Destination table for query results For Bulk v1 load jobs: The original input table name, otherwise the operation will fail For Bulk v2 load jobs: Desired destination table root name. Three result tables will be created from it |
@exists_action | VARCHAR(20) | NULL | Action to take if the destination table name(s) specified by @table are already taken. Applicable to Bulk queries and Bulk v2 load jobs only. If NULL, uses the value from SLAM_Settings.default_exists_action (defaulted to 'drop' during initial setup).Valid options:
|
Usage Examples:
Bulk Query - Download results from a completed Bulk v1 or Bulk v2 query job:
EXEC dbo.SLAM_query_bulk
@query = 'Account',
@table = 'Account_query'
-- Some interruption happens during query job
EXEC dbo.SLAM_download_job
@job_id = '7503C00123456789AAA',
@table = 'Account_query'
Bulk v1 - Download results from a completed data load job:
EXEC dbo.SLAM_load_bulk
@sObject = 'Account',
@table = 'Account_LOAD',
@operation = 'insert'
-- Some interruption happens during loading process
EXEC dbo.SLAM_download_job
@job_id = '7504D00987654321AAA',
@table = 'Account_LOAD'
Bulk v2 - Download results from a completed data load job:
EXEC dbo.SLAM_load_bulkv2
@sObject = 'Account',
@table = 'Account_LOAD',
@operation = 'insert'
-- Some interruption happens during loading process
EXEC dbo.SLAM_download_job
@job_id = '7504D00987654321AAA',
@table = 'Account_LOAD_results'
SELECT * FROM Account_LOAD_results_successful
SELECT * FROM Account_LOAD_results_failed
SELECT * FROM Account_LOAD_results_unprocessed