Example 2: Predefined method - Connect_CDC - connect_cdc_mimix_share - 5 - 5.8

Connect CDC Advanced User Guide

Product type
Product family
Connect > Connect CDC (MIMIX Share)
Product name
Connect CDC
Connect CDC Advanced User Guide
First publish date

The supplier in this scenario also keeps the starting date for a customer’s account (in the CRE_DATE column). On the Mapping tab, however, the target column CRE_DATE has no corresponding source column and was not automatically mapped. This is so because the starting date was originally entered in a character-based CREATE_DATE column. The task now is to transfer the CHARACTER source column date to a target column whose datatype is DATE.

In this case, you can use a Connect CDC built-in function, dateformat, to operate on the character-formatted source column value and output a suitably formatted result for the target column:

  1. In the Method column for the CRE_DATE target column, select Expression.

  2. Click the Edit source button at the bottom of the window to display the Target Column Expression window.

  3. From the Method list, select Date format3, then click the Insert button.
    • The dateformat function name is displayed in the expression workbox to the left.

    • The Date format3 method information (description, return value, and parameters) is displayed below the Method list.

    You can use the displayed function information as a guide for specifying the function expression in the workbox to the left. For more detailed function information, click the Help button and find the link to the predefined methods summary.

    Note:  Date format3 and dateformat are described in detail in System Reference.
  4. After placing your cursor between the parentheses following dateformat in the expression workbox, provide a value for the first dateformat parameter (input), the character column you are converting. From the Column list, select CREATE_DATE and click the Insert button.

  5. Select the comma operator (,) from the Operator list, then click the Insert button.

  6. Provide a value for the second dateformat parameter (output_format), the pattern of the date output sent to the target database (Oracle, in our example). The valid dateformat pattern characters are described in the detailed information for the function in the online Help.

  7. Type the following string in the expression workbox to define the standard Oracle date format:

    ‘yyyy-MM-dd hh:mm:ss.SSSSSS’
  8. After adding a comma to the previous string, provide the following value for the the third dateformat parameter (input_format), the format of the date values in the CREATE_DATE source column. For the month/day/two-number-year values in our example, specify:

  9. Click the Validate button to verify that the expression is syntactically valid.

  10. Click OK once the expression is valid.

  11. Click OK to close the Target Column Expression dialog.

    The Source Data value for the CRE_DATE column displays the expression.

  12. Click OK from the Mapping tab to close the Sending Table Properties dialog box.

The Connect CDC Director does additional verification that includes, for example, the compatibility of the datatypes and of the built-in method you have selected. If your entries are valid, the dialog box closes without any other message.

If necessary, you may find useful debugging information in the Connect CDC Director log, omnidir.log, and in the Expression Handler log, omnijvm.log.