Tuesday, June 18, 2013

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.

No comments: