Table of Contents

Search

  1. Preface
  2. Working with Transformations
  3. Aggregator Transformation
  4. Custom Transformation
  5. Custom Transformation Functions
  6. Data Masking Transformation
  7. Data Masking Examples
  8. Expression Transformation
  9. External Procedure Transformation
  10. Filter Transformation
  11. HTTP Transformation
  12. Identity Resolution Transformation
  13. Java Transformation
  14. Java Transformation API Reference
  15. Java Expressions
  16. Java Transformation Example
  17. Joiner Transformation
  18. Lookup Transformation
  19. Lookup Caches
  20. Dynamic Lookup Cache
  21. Normalizer Transformation
  22. Rank Transformation
  23. Router Transformation
  24. Sequence Generator Transformation
  25. Sorter Transformation
  26. Source Qualifier Transformation
  27. SQL Transformation
  28. Using the SQL Transformation in a Mapping
  29. Stored Procedure Transformation
  30. Transaction Control Transformation
  31. Union Transformation
  32. Unstructured Data Transformation
  33. Update Strategy Transformation
  34. XML Transformations

Transformation Guide

Transformation Guide

Defining the SQL Transformation

Defining the SQL Transformation

The SQL transformation connects to the database and runs a dynamic SQL query that inserts the customer data into the CUST table.
When you create an SQL transformation, you define the transformation mode, the database type, and the type of connection. You cannot change the mode or connection type after you create the transformation.
Create an SQL transformation with the following properties:
  • Query Mode.
    The SQL transformation executes dynamic SQL queries.
  • Dynamic Connection.
    The SQL transformation connects to databases depending on connection information you pass to the transformation in a mapping.
  • Connection Object.
    The SQL transformation has a LogicalConnectionObject port that receives the connection object name. The connection object must be defined in the Workflow Manager connections.
The following figure shows the ports in the SQL transformation:
The SQL Ports tab in Edit Transformations dialog box contains the port name, datatype, native type, precision, and scale columns. The SQL Ports tab also contains the Transformation Name, Transformation Type, Default Value, Description, SQL Query, and Query Description fields.
The SQL transformation receives the connection object name in the LogicalConnectionObject port. It connects to the database with the connection object name each time it processes a row.
The transformation has the following dynamic SQL query to insert the customer data into a CUST table:
INSERT INTO CUST VALUES (?CustomerId?,?CustomerName?,?PhoneNumber?,?Email?);
The SQL transformation substitutes parameters in the query with customer data from the input ports of the transformation. For example, the following source row contains customer information for customer number 1:
1,John Smith,6502345677,jsmith@catgary.com,US
The SQL transformation connects to the database with the DBORA_US connection object. It executes the following SQL query:
INSERT INTO CUST VALUES (1,’John Smith’,’6502345677’,’jsmith@catgary.com’);

0 COMMENTS

We’d like to hear from you!