Table of Contents

Search

  1. Preface
  2. Data Replication Overview
  3. Understanding Data Replication
  4. Sources - Preparation and Replication Considerations
  5. Targets - Preparation and Replication Considerations
  6. Starting the Server Manager
  7. Getting Started with the Data Replication Console
  8. Defining and Managing Server Manager Main Servers and Subservers
  9. Creating and Managing User Accounts
  10. Creating and Managing Connections
  11. Creating Replication Configurations
  12. Materializing Targets with InitialSync
  13. Scheduling and Running Replication Tasks
  14. Implementing Advanced Replication Topologies
  15. Monitoring Data Replication
  16. Managing Replication Configurations
  17. Handling Replication Environment Changes and Failures
  18. Troubleshooting
  19. Data Replication Files and Subdirectories
  20. Data Replication Runtime Parameters
  21. Command Line Parameters for Data Replication Components
  22. Updating Configurations in the Replication Configuration CLI
  23. DDL Statements for Manually Creating Recovery Tables
  24. Sample Scripts for Enabling or Disabling SQL Server Change Data Capture
  25. Glossary

Adding a Virtual Column with an SQL or Tcl Expression

Adding a Virtual Column with an SQL or Tcl Expression

After you define an SQL or Tcl expression for a source table, you must assign it to a virtual column. Then map the virtual source column to a column in the corresponding target table.
Data Replication validates that the virtual column and target column have compatible datatypes. If the datatypes are not compatible, the Data Replication Console displays an error message that prompts you to map the virtual column to a target column that has a compatible datatype. For more information about compatible datatypes, see the
Informatica Data Replication Datatype Mapping Reference
.
  1. On the
    Map Columns
    tab, in the
    Source Table
    list, select the source table for which you previously defined a Tcl or SQL expression.
  2. Click the
    Add Virtual Column
    icon button above the source columns box, or right-click any source column row and click
    Add Virtual Column
    .
    The
    Add virtual column
    dialog box appears.
    Add virtual column dialog box
  3. In the
    Column name
    field, enter a unique virtual column name.
    A virtual column name can be no longer than 50 characters and can include only the digits 0-9, Latin letters A-Z and a-z, and the underscore (_) character.
    Do not create a virtual column that has the same name as another virtual column in the same table.
  4. In the
    Data type
    list, select the virtual column datatype.
    The following table describes the virtual column datatypes:
    Datatype
    Description
    BIGINT
    Big integers.
    Storage size: 8 bytes
    Range of values: -2^63 (-9223372036854775808) through
    2^63-1 (9223372036854775807)
    DATE
    Combined date and time value.
    Date format for Tcl scripts: yyyy-mm-dd hh:mm:ss
    Date format for SQL expressions: target database format
    DECIMAL(
    p
    ,
    s
    )
    Decimal numbers with the declared precision and scale. Scale must be less than or equal to precision.
    Valid precision values: 1 through 38
    Valid scale values: 0 through 38
    DOUBLE
    Double-precision floating-point numbers.
    Storage size: 8 bytes
    Range of values: -7.2E+75 through 7.2E+75
    FLOAT
    Single-precision floating-point numbers.
    Storage size: 4 bytes
    Range of values: -3.40E + 38 through -1.18E - 38, 0 and
    1.18E - 38 through 3.40E + 38
    INTEGER
    Large integers.
    Storage size: 4 bytes
    Range of values: -2^31 (-2147483648) through 2^31 - 1 (2147483647)
    NVARCHAR(
    n
    )
    Variable-length Unicode data.
    Valid length values: 1 through 4000 bytes
    TIMESTAMP(
    f
    )
    Date and time value that includes the year, month, day, hour, minutes, and seconds.
    Timestamp format for Tcl scripts: yyyy-mm-dd hh:mm:ss ff
    Timestamp format for SQL expressions: target database format
    The
    f
    value is the number of digits in the fractional part of seconds.
    Valid fractional seconds precision values: 0 through 9
    VARCHAR(
    n
    )
    Variable-length non-Unicode data.
    Valid length values: 1 through 4000 bytes
  5. In the
    Expression
    list, select the Tcl or SQL expression that you previously defined.
  6. Click
    OK
    to save the column-expression association.
    To view virtual columns that use a particular expression, in the
    Add/Show expressions
    dialog box, right-click the expression row and click
    List virtual columns
    .
  7. On the
    Map Columns
    view, map the virtual source column with the Tcl or SQL expression to the corresponding target column. These columns must have compatible datatypes.
    For more information about recommended datatype mappings for virtual source columns, see the
    Informatica Data Replication Datatype Mapping Reference
    .
    When you run the InitialSync or the Applier component later, the component evaluates the expression for the virtual column and writes the result to the corresponding target column.

0 COMMENTS

We’d like to hear from you!