#1 2012-05-08 11:19:47

distinct_limerick
New member
Registered: 2012-05-01
Posts: 7

[resolved] assigning value to a context variable.

HI All,

I'm pretty new to talend and am trying to assign the sum of a list of values in a postgreSQL table to a context variable.

I have set up the job as follows:

tPostgreSQLInput
      |
(main)
      |
tjavarow

My sql statement is something like: select sum(value) from table. What I am not sure of is what to put in the tjavarow component. I currently have context.sum_value = input_row.value but this does not work?

Any help would be appreciated, Thanks!!

Offline

 

#2 2012-05-08 11:56:45

distinct_limerick
New member
Registered: 2012-05-01
Posts: 7

Re: [resolved] assigning value to a context variable.

Just got it,

the problem was in the schema definition of the tpostgresqlinput component.

I had defined the full table schema. This needs to be trimmed down to just one row definition when that one row is the only one being used in the query.

Hope this helps if someone else has this problem.

Offline

 

Board footer

Powered by FluxBB