[resolved] Context param in shell script

One Star

[resolved] Context param in shell script

Hi everybody.

I'm hooked on a problem after Exporting the job. I'm kind of new on talend and i don't know a lot of things about java.

When i call it from the shell
/myscript.sh --context_param date_debut=2010-09-21 --context_param date_fin=2010-09-22

I have this error =>

Exception in component tInformixInput_1 java.lang.NullPointerException at java.util.Calendar.setTime(Calendar.java:1075) at routines.system.FastDateParser$DateParser.format(FastDateParser.java:99) at java.text.DateFormat.format(DateFormat.java:316) at routines.TalendDate.formatDate(TalendDate.java:46) at informix_exapaq.myjob_0_1.myjob.tInformixInput_1Process(myjob.java:497) at informix_exapaq.myjob_0_1.myjob.runJobInTOS(myjob.java:887) at informix_exapaq.myjob_0_1.myjob.main(myjob.java:739)

I have my context_param in my Informix request built has =>
"+TalendDate.formatDate("yyyy-MM-dd", context.date_debut)+" 12:00:00

AND
"+TalendDate.formatDate("yyyy-MM-dd", context.date_fin)+" 12:00:00

But if i understand well. This a date format problem. Or i don't know where something is wrong.

If you have an idea Smiley Happy

Rude
One Star

Re: [resolved] Context param in shell script

So i saw in the forum rules that "ups" are tolerate so... "up" Smiley Happy
Community Manager

Re: [resolved] Context param in shell script

Hello
1. Set the data type of context variable as string, because I see you are converting a Date to a string, why don't you use string type directly?
2. Use the context variable in the Informix request like :
"+context.mydate+" 12:00:00"

3. Re-export the job script.
4. Execute the job script
/myscript.sh --context=Default --context_param date_debut=2010-09-21 --context_param date_fin=2010-09-22

Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Context param in shell script

Thank you i'm gonna try that tomorrow. I'll keep you posted.
One Star

Re: [resolved] Context param in shell script

Thx a lot that works Smiley Happy
One Star

Re: [resolved] Context param in shell script

thaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaanks a lot Smiley Happy

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

Have you checked out Talend’s 2019 Summer release yet?

Find out about Talend's 2019 Summer release

Blog

Talend Summer 2019 – What’s New?

Talend continues to revolutionize how businesses leverage speed and manage scale

Watch Now

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog