Table of Contents

Search

  1. Preface
  2. Workflows
  3. Workflow Variables
  4. Workflow Parameters
  5. Cluster Tasks
  6. Command Task
  7. Human Task
  8. Mapping Task
  9. Notification Task
  10. Gateways
  11. Workflow Recovery
  12. Workflow Administration

Developer Workflow Guide

Developer Workflow Guide

Changing the Format of Date Variables

Changing the Format of Date Variables

The Data Integration Service uses the format
DAY MON DD HH24:MI:SS YYYY
for workflow variables with a date datatype. You can use an Assignment task to change the default format of a date variable.
Use an Assignment task to convert the date value to a string value with a specified date format. Then, assign the converted value to a string workflow variable.
  1. Create a user-defined workflow variable with a string datatype.
  2. Add an Assignment task to the workflow after the task that assigns a run-time value to the date workflow variable.
  3. Connect the Assignment task to other objects in the workflow.
  4. Select the Assignment task in the editor.
  5. In the
    Properties
    view, click the
    Assignment
    tab.
  6. In the
    User-defined Variable
    column, select the string workflow variable.
  7. Click the arrow in the
    Expression
    column.
    The
    Assignment Expression Editor
    appears.
  8. Enter the following expression to convert the value of the date workflow variable to a string value with the specified date format:
    TO_CHAR(
    date_variable
    [,
    format
    ])
    For example, enter the following expression:
    TO_CHAR($var:MyDateVariable, 'MM/DD/YYYY HH24:MI:SS')
  9. Click
    Validate
    to validate the expression.
    Errors appear in a dialog box.
  10. Fix errors and validate the expression again.
  11. Click
    OK
    .
  12. Use the string workflow variable in an expression or task field.

0 COMMENTS

We’d like to hear from you!