Professional Documents
Culture Documents
Stored Procedure Transformation is a passive transformation. It can be used in both connected and
unconnected mode.
Stored procedures are stored and run within the database. They contain a pre-compiled collection of PLSQL statements. The stored procedures in the database are executed using the Execute or Call
statements. Informatica provides the stored procedure transformation which is used to run the stored
procedures in the database.
Some of the tasks you can do with stored procedures are listed below:
Check the status of a target database before loading data into it.
Determine if enough space exists in a database.
Perform a specialized calculation.
Dropping and recreating indexes.
The stored procedure must exist in the database before creating a Stored Procedure transformation,
and the stored procedure can exist in a source, target, or any database with a valid connection to the
Integration Service.
Input / Output Parameters: Used to send and receive data from the stored procedure.
Return Values: After running a stored procedure, most databases returns a value. This value can
either be user-definable, which means that it can act similar to a single output parameter, or it
may only return an integer value. If a stored procedure returns a result set rather than a single
return value, the Stored Procedure transformation takes only the first value returned from the
procedure.
Status Codes: Status codes provide error handling for the Integration Service during a workflow.
Stored procedure issues a status code that notifies whether or not the stored procedure
completed successfully. You cannot see this value.
Normal: The stored procedure transformation runs for each row passed in the mapping. This is
useful when running a calculation against an input port. Connected stored procedures run
only in normal mode.
Pre-load of the Source: Runs before the session reads data from the source. Useful for
verifying the existence of tables or performing joins of data in a temporary table.
Post-load of the Source: Runs after reading data from the source. Useful for removing
temporary tables.
Pre-load of the Target: Runs before the session sends data to the target. This is useful for
verifying target tables or disk space on the target system.
Post-load of the Target: Runs after loading data into the target. This is useful for re-creating
indexes on the database.
Create a stored procedure in the source database (HR) to compute the sum of salary and
commission of an employee:
create procedure
add_sal_comm (i_emp_id in number, total out number) is
begin
select salary+( salary* NVL(COMMISSION_PCT,0))
into total
from employees
where employee_id = i_emp_id;
end;
The stored procedure import wizard appears, connext to the HR database and select the required
stored procedure (add_sal_comm)
Connect the employee_id port of source qualifier transformation to the I_EMP_ID port of stored
procedure transformation.
Connect the employee_id port of source qualifier transformation to the employee_id port of
target.
Connect the total port of stored procedure transformation to the total port of target.
Populate the remaining ports of the target from the source qualifier
Click on Mapping ( from tool bar) -> then Validate ( to validate the mapping)
Now save the mapping ( by clicking on Repository-> Save or you can also press Ctrl+S)
Generate the workflow and run it