In the Command on Target tab, fill in the following fields:

12-8 Oracle Fusion Middleware Developers Guide for Oracle Data Integrator When batch update and array fetch are supported by the target and source technologies respectively, ODI prepares arrays in memory for every batch, making the overall transaction more efficient. Example 12–2 Sending Multiple Emails Suppose you have a table that contains information about all the people that need to be warned by email in case of a problem during the loading of your Data Warehouse. You can do it using a single procedure step as described in Table 12–2 . The “–TO” parameter will be substituted by the value coming from the “Email” column of your source SELECT statement. The “OdiSendMail” command will therefore be triggered for every operator registered in the “Operators” table.

12.1.3 Using Procedures

A procedure can be used in the following ways: ■ Executing the Procedure directly in Designer Navigator for testing its execution. ■ Using a Procedure in a Package along with interfaces and other development artifacts for building a data integration workflow. ■ Generating a Scenario for a Procedure for launching only this procedure in a run-time environment.

12.1.3.1 Executing the Procedure

To run a procedure:

1. In the Project view of the Designer Navigator, select the procedure you want to

execute. Note: This mechanism is known to be far less efficient than a fast or multi load in the target table. You should only consider it for very small volumes of data. The section Using the Agent in the Loading Strategies further discusses this mechanism. Table 12–2 Procedure Details for Sending Multiple Emails Source Technology Oracle Source Logical Schema ORACLE_DWH_ADMIN Source Command Select FirstName FNAME, EMailaddress EMAIL From =odiRef.getObjectNameL,Operators,D Where RequireWarning = ’Yes’ Target Technology ODITools Target Logical Schema None Target Command OdiSendMail -MAILHOST=my.smtp.com -FROM=adminmycompany.com “-TO=EMAIL” “-SUBJECT=Job Failure” Dear FNAME, I’m afraid you’ll have to take a look at ODI Operator, because session =snpRef.getSession“SESS_NO” has just failed -Admin Working with Procedures, Variables, Sequences, and User Functions 12-9

2. Right-click and select Execute.

3. In the Execution dialog, set the execution parameters. Refer to

Table 20–1 for more information.

4. Click OK.

5. The Session Started Window appears.

6. Click OK.

12.1.3.2 Using a Procedure in a Package

Procedures can be used as package steps. Refer to the Section 10.3.1.2, Executing a Procedure for more information on how to execute a procedure in a package step. Note that if you use a procedure in a package step, the procedure is not a copy of the procedure you created but a link to it. If this procedure is modified outside of the package, the package using the procedure will be changed, too.

12.1.3.3 Generating a Scenario for a Procedure

It is possible to generate a scenario to run a procedure in production environment, or to schedule its execution without having to create a package using this procedure. The generated scenario will be a scenario with a single step running this procedure. How to generate a scenario for a procedure is covered in Section 13.2, Generating a Scenario .

12.1.4 Encrypting and Decrypting Procedures

Encrypting a Knowledge Module KM or a procedure allows you to protect valuable code. An encrypted KM or procedure can neither be read nor modified if it is not decrypted. The commands generated in the log by an Encrypted KM or procedure are also unreadable. Oracle Data Integrator uses a DES Encryption algorithm based on a personal encryption key. This key can be saved in a file and reused to perform encryption or decryption operations.

12.1.4.1 Encrypting a KM or Procedure

To encrypt a KM or a Procedure:

1. Right-click the KM or procedure you wish to encrypt.

2. Select Encrypt.

Note: During this execution the Procedure uses the option values set on the Options tab of the Procedure editor. Note: If you don’t want to use the option values set on the Options tab of the Procedure, set the new options values directly in the Options tab of the Procedure step. WARNING: There is no way to decrypt an encrypted KM or procedure without the encryption key. It is therefore strongly advised to keep this key in a safe location. It is also advised to use a unique key for all the developments.