Skip to main content

Stored Procedure Transformations In Informatica



STORED PROCEDURE


  • A procedure is a pre-defined set of PL/SQL statements to carry out a task. 

  • It is a Passive Transformation 

  • It is used to manage (USED BY DBA) and populate (USED BY DEVELOPER) the target database. 

  • Operations accomplished through Stored Procedures



With Stored Procedures we can do the following operations: 

Checking the Target Disk availability.

If we want to load the data to the target, before loading we need to make sure if there is enough space on the target disk. Used by DBA.
Check the Target table availability.

If the target is used in some other mapping, it cannot be used at the same time. Example three different mappings (one for INSERT, DELETE and UPDATE) can be used for the same target. Used by DBA.
Dropping and Recreating Indexes.

For Bulk Loading, we need to drop the index first and recreate the index after the load is done.
Perform specialized calculations.


Types of Stored Procedure Transformations
Normal
Source Pre-load or Pre-Source Load
Source Post Load or Post Source Load 

Pre-target Load or Target Pre-Load
Post-Target Load or Target Post-Load



Normal

By default, SP type is normal. It can be used for calculations. It can be used in two different types of transformations – connected SP or unconnected SP.
Source Pre-Load or Pre-Source Load

By using Source Pre-load, we can execute a procedure against Source Database before Source (SQ) executes.
Source Post Load or Post Source Load

By using Source Post load, we can execute a procedure against Source database after Source Query (SQ) executes. Example – Indexes
Pre-target Load or Target Pre-Load

Before executing the target process or query on the target, we can use SP executing against the target database.
Post-Target Load or Target Post-Load

After executing the target process or query on the target, we can use SP executing against the target database. Example, Recreating the Index.


Ports:

Input,Output,Return

Suppose we have a stored procedure to calculate annual salary of an employee.

Input Parameter is SAL and output is AN_SAL.

SQL> create or replace procedure calc_an_sal(p_sal IN emp.sal%TYPE,

p_an_sal OUT emp.sal%TYPE)

IS

BEGIN

p_an_sal:=P_SAL*12; (Bad Practice )

select sal*12

INTO p_an_sal

FROM EMP

WHERE sal=p_sal;

END;

Procedure created.

SQL> variable an_sal number;

SQL> execute calc_an_sal(1300,:an_sal);

PL/SQL procedure successfully completed.

SQL> print an_sal

AN_SAL

----------

15600





Define a Mapping M_SP. Drag Source (EMP),Target (EMP_SP) to the mapping designer.

Create a Stored Procedure transformation T_SP.
Stored Procedure Transformations In Informatica
Stored Procedure Transformations In Informatica



Connect to the database which has the required SP. In our case we have the SP to calculate annual salary on the Source Database (SCOTT).

Form the Procedures tab select calc_an_sal.
Stored Procedure Transformations In Informatica
Stored Procedure Transformations In Informatica


Stored Procedure Transformations In Informatica
Stored Procedure Transformations In Informatica






Edit the SP transformation and go to Ports tab.
Stored Procedure Transformations In Informatica
Stored Procedure Transformations In Informatica



In the Transformation T_SP we have P_SAL (input parameter) and P_AN_SAL (output parameter).






Connect Source port Sal to Transformation port P_SAL, transformation port P_AN_SAL to the target port AN_SAL. Project the remaining ports directly from source to the target.
Stored Procedure Transformations In Informatica
Stored Procedure Transformations In Informatica








Edit the Transformation and go to Properties tab.
Stored Procedure Transformations In Informatica
Stored Procedure Transformations In Informatica








By default, the value for connection information is $target.

In our case, we have defined the SP on Source (SCOTT) so we select that.
Stored Procedure Transformations In Informatica
Stored Procedure Transformations In Informatica




Stored Procedure Type is Normal.

Stored Procedure Transformations In Informatica

Save the repository.




Define the workflow. Assign Source, Target and Transformation Connections.
Stored Procedure Transformations In Informatica
Stored Procedure Transformations In Informatica







Define a workflow.

Assign the source,target and Transfromation (SP) connections.

Start the workflow and preview the output.
Stored Procedure Transformations In Informatica
Stored Procedure Transformations In Informatica

Comments

Post a Comment

Popular posts from this blog

Contact Me

Do You have any queries ?                   If you are having any query or wishing to get any type of help related Datawarehouse, OBIEE, OBIA, OAC then please e-email on below. I will reply to your email within 24 hrs. If I didn’t reply to you within 24 Hrs., Please be patience, I must be busy in some work. kashif7222@gmail.com

Top 130 SQL Interview Questions And Answers

1. Display the dept information from department table.   Select   *   from   dept; 2. Display the details of all employees   Select * from emp; 3. Display the name and job for all employees    Select ename ,job from emp; 4. Display name and salary for all employees.   Select ename   , sal   from emp;   5. Display employee number and total salary   for each employee. Select empno, sal+comm from emp; 6. Display employee name and annual salary for all employees.   Select empno,empname,12*sal+nvl(comm,0) annualsal from emp; 7. Display the names of all employees who are working in department number 10   Select ename from emp where deptno=10; 8. Display the names of all employees working as   clerks and drawing a salary more than 3000   Select ename from emp where job=’clerk’and sal>3000; 9. Display employee number and names for employees who earn commissi...

Informatica sample project

Informatica sample project - 1 CareFirst – Blue Cross Blue Shield, Maryland (April 2009 – Current) Senior ETL Developer/Lead Model Office DWH Implementation (April 2009 – Current) CareFirst Blue Cross Blue Shield is one of the leading health care insurance provided in Atlantic region of United States covering Maryland, Delaware and Washington DC. Model Office project was built to create data warehouse for multiple subject areas including Members, Claims, and Revenue etc. The project was to provide data into EDM and to third party vendor (Verisk) to develop cubes based on data provided into EDM. I was responsible for analyzing source systems data, designing and developing ETL mappings. I was also responsible for coordinating testing with analysts and users. Responsibilities: ·          Interacted with Data Modelers and Business Analysts to understand the requirements and the impact of the ETL on the business. ·  ...