[resolved] Get the current Date into a Schema definition

One Star

[resolved] Get the current Date into a Schema definition

Hi,
I'm runing out of tips trying to handle a default value for a date.
Is it possible to get the current date as default value into a metadata schema ?

I've tried TalendDate.getCurrentDate(), new java.util.Date(), sysdate etc... nothing works. I really want to handle it into the metadata, it seems much more "clean" to me, to handle it here, I don't wanna use variables into tmap or tJava that is too tricky, and I want to keep my jobs easy to maintain !
Moderator

Re: [resolved] Get the current Date into a Schema definition

Hi,
You cannot use TalendDate.getCurrentDate() as default value in schema setting.
You have to use the expression you already know in the tMap or tJava.
The default values in the database will only be used if you do not fill the column and set null as value is always a attempt to fill the column and prevents the database from setting the default value.
For default value, please take a look at a KB document:https://help.talend.com/search/all?query=Verifying+default+values+in+a+retrieved+schema&content-lang...
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Get the current Date into a Schema definition

Thanks Sabrina, that's too bad but I can deal with it
Let's use tmap then
Moderator

Re: [resolved] Get the current Date into a Schema definition

Hi,
Feel free to let us know if there is any further help we can give.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch