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

Rebind Datatype Functions

Rebind Datatype Functions

You can rebind a port with a datatype other than the default datatype with PowerCenter. Use the rebind datatype functions if you want the procedure to access data in a datatype other than the default datatype. You must rebind the port with a compatible datatype.
You can only use these functions in the initialization functions.
Consider the following rules when you rebind the datatype for an output or input/output port:
  • You must use the data handling functions to set the data and the indicator for that port. Use the INFA_CTSetData() and INFA_CTSetIndicator() functions in row-based mode, and use the INFA_CTASetData() function in array-based mode.
  • Do not call the INFA_CTSetPassThruPort() function for the output port.
The following table lists compatible datatypes:
Default Datatype
Compatible With
Char
Unichar
Unichar
Char
Date
INFA_DATETIME
Use the following syntax:
struct INFA_DATETIME { int nYear; int nMonth; int nDay; int nHour; int nMinute; int nSecond; int nNanoSecond; }
Dec18
Char, Unichar
Dec28
Char, Unichar
PowerCenter provides the following rebind datatype functions:
  • INFA_CTRebindInputDataType().
    Rebinds the input port. Use the following syntax:
    INFA_STATUS INFA_CTRebindInputDataType(INFA_CT_INPUTPORT_HANDLE portHandle, INFA_CDATATYPE datatype);
  • INFA_CTRebindOutputDataType().
    Rebinds the output port. Use the following syntax:
    INFA_STATUS INFA_CTRebindOutputDataType(INFA_CT_OUTPUTPORT_HANDLE portHandle, INFA_CDATATYPE datatype);
    The following table describes the arguments for this function:
    Argument
    Datatype
    Input/
    Output
    Description
    portHandle
    INFA_CT_OUTPUTPORT _HANDLE
    Input
    Output port handle.
    datatype
    INFA_CDATATYPE
    Input
    The datatype with which you rebind the port. Use the following values for the datatype parameter:
    • eINFA_CTYPE_SHORT
    • eINFA_CTYPE_INT32
    • eINFA_CTYPE_CHAR
    • eINFA_CTYPE_RAW
    • eINFA_CTYPE_UNICHAR
    • eINFA_CTYPE_TIME
    • eINFA_CTYPE_FLOAT
    • eINFA_CTYPE_DOUBLE
    • eINFA_CTYPE_DECIMAL18_FIXED
    • eINFA_CTYPE_DECIMAL28_FIXED
    • eINFA_CTYPE_INFA_CTDATETIME
The return value datatype is INFA_STATUS. Use INFA_SUCCESS and INFA_FAILURE for the return value.

0 COMMENTS

We’d like to hear from you!