Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I want to stock a date (timestamp) in a variable to use it late in a query (PostgreSQL). so i used tsetGlobalVar and then in my query i used this query :
WHERE SX.\"Date\" = "+TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss", (String)globalMap.get("row2.DateKey"))+"
And i get a java.lang.NullPointerException Error
I think the problem is in parsing Timestamp, please can anyone help me
and you can use TalendDate.formatDate("yyyy-MM-dd'T'HH:mm:ss",row2.MaxDate) in your globalvar value
then you put it as a string in the query with (String)globalMap.get("DateKey")
you can also use to_char((your date value)::timestamp, 'yyyy-MM-dd'T'HH:mm:ss') in your postgre select to convert it directly to string