Running SQL Script As A Pre-Post Job

Running SQL Script As A Pre-Post Job

book

Article ID: KB0078618

calendar_today

Updated On:

Products Versions
TIBCO Scribe Insight 7.9.1

Description

This example shows how to run a SQL script (.sql) as a Pre/Post job from the TIBCO Scribe® Insight Console. Scripts have many uses, such as creating a backup of a source file before processing it and then deleting that file when TIBCO Scribe® Insight is finished processing it.

The Pre/Post job invokes a DOS .cmd file which in turn runs SQLCMD.exe SQLCMD.exe is responsible for invoking the .sql script.
 
kA2320000004Gm4CAE_en_US_1_0

Issue/Introduction

Scripts have many uses, such as creating a backup of a source file before processing it and then deleting that file when TIBCO Scribe® Insight is finished processing it.

Resolution

The first step is to modify the .cmd file so that the proper SQL Server references the .sql file name.
 
kA2320000004Gm4CAE_en_US_1_1

The SQL Script can be anything. In this case, it is executing a stored procedure.
 
kA2320000004Gm4CAE_en_US_1_2

Once the changes have been made, test the process by running the command file from the DOS prompt. Verify the SQL script has properly executed. A DOS and SQL log file are created using the values in the .cmd file. Review these files for any errors.
 
kA2320000004Gm4CAE_en_US_1_3



 

Additional Information

For additional information, see the following in TIBCO Scribe® Insight Help: Adding An Integration Process, Configuring An Integration Process – Processing Commands