Featured Post

Applying Email Validation to a JavaFX TextField Using Binding

This example uses the same controller as in a previous post but adds a use case to support email validation.  A Commons Validator object is ...

Friday, February 4, 2011

SYSDATE in Talend Open Studio

You can set dates in Talend Open Studio using Java, MySQL functions, SQL functions, Talend functions, or user-defined functions.

In Talend Open Studio, there are several ways to retrieve the current date for using in loading and transformation.

In components like tMap, you can use Talend functions or Java.  In tMap, select the Expression Editor and enter the following in one of the target fields.

TalendDate.getCurrentDate()

or

new java.util.Date()

If you're using tMySQLMap, you use MySQL functions. The Expression Editor isn't available in tMySQLMap, so enter the following manually.

NOW()

Another option is to embed the generated date in the source SQL. For example, rather than using a query like

SELECT * FROM SR_DIM_SYSTEM

which is generally the default, try

SELECT system_nm, system_descr_tx, NOW() FROM SR_DIM_SYSTEM.

2 comments:

  1. Carl, Thank you once again for this new post on Talend.

    Talend Community Manager

    ReplyDelete
  2. Nice blog on Talend Carl.

    ReplyDelete