Skip to Content

In this article we will discuss How to use Pre-Load and Post-Load command in data services.

Business Requirement:  Need to execute two programs before and after transformation. The first program will create or update status to receive data from source to Target system and the second program will publish the post transformed data in Target system. These two program needs to execute before and after transformation.

For this scenario, we can use Pre-Load and Post-Load command. Below the details

What is Pre-Load and Post Load?

Specify SQL commands that the software executes before starting a load or after finishing a load. When a data flow is called, the software opens all the objects (queries, transforms, sources, and targets) in the data flow. Next, the software executes Pre-Load SQL commands before processing any transform. Post-Load command will process after transform.

How to use for our business requirement?

We can use both Pre-Load and Post-Load command to execute program before and after transform, below the steps will explain in details

Right click on target object in Dataflow and press open

/wp-content/uploads/2014/03/1_421002.png

The Target object option will be shown as below

1-a.PNG

Both the Pre Load Commands tab and the Post Load Commands tab contain a SQL Commands box and a Value box. The SQL Commands box contains command lines. To edit/write a line, select the line in the SQL Commands box. The text for the SQL command appears in the Value box. Edit the text in that box.

2.PNG

To add a new line, determine the desired position for the new line, select the existing line immediately before or after the desired position, right-click, and choose Insert Before to insert a new line before the selected line, or choose Insert After to insert a new line after the selected line. Finally, type the SQL command in the Value box. You can include variables and parameters in pre-load or post-load SQL statements. Put the variables and parameters in either brackets, braces, or quotes.

1-b.PNG

1-C.PNG

To delete a line, select the line in the SQL Commands box, right click, and choose Delete.

1-D.PNG

Open Post-Load Tab and write post transformation command as same ad Pre-Load

1-E.PNG

Save and execute. The job will execute Pre-Load, Transform and Post-Load in a sequence.

1-f.PNG

Data processing successfully completed as per Business requirement.

Note:

Because the software executes the SQL commands as a unit of transaction, you should not include transaction commands in Pre-Load or Post-Load SQL statements.

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply