Unanswered posts

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] Can the SQL Expression in "Additional Columns" be dynamically modified

#1 2010-02-24 19:46:15

jbaird123
Member
Registered: 2010-01-26
Posts: 60

[resolved] Can the SQL Expression in "Additional Columns" be dynamically modified

Is it possible to dynamically modify the value of the SQL Expression field in the Additional Columns section of a tOracleOutput component?

I've been trying to use a context variable to see if I can change this value on the fly, but it does not seem to be working.

Here is what I've done so far:

1. Create a context variable called var1 and assign it a value of ''ValueSetInContext''.
2. Create a flow which inserts data into an Oracle table via tOracleOutput component (using Drop table in exists and create option).
3. In the Additional Columns section, I add a new column called "DUMMY" and in the SQL Expression field I put this:  context.var1
4. Run the program, and I can see that the DUMMY field got populated with this string:  ValueSetInContext
5. Next, I decided to send the data flow through a tJavaRow component so I could modify the value of the context.var1 variable.  In this component, I have this code:

                context.var1="ValueSetIntJavaComponent";
                System.out.println(context.var1);

6. Then I map the data flow from the tJavaRow component into the tOracleOutput component just as before (leaving the value of the SQL Expression as context.var1).
7. Run the program, and the DUMMY field still gets populated with ValueSetInContext instead of ValueSetIntJavaComponent. 

My conclusion is that the SQL Expression gets evaluated right at the beginning of the job execution and never changes after that. 

Can anyone verify this or provide an example of how to modify that value on the fly?

Thanks.

Offline

#2 2010-02-25 04:58:51

shong
Talend team
Registered: 2007-08-29
Posts: 10305
Website

Re: [resolved] Can the SQL Expression in "Additional Columns" be dynamically modified

Hello
You need use tFlowToIterate to iterate each row. See my screenshots.

Best regards

         shong


Uploaded Images


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#3 2010-02-25 17:43:17

jbaird123
Member
Registered: 2010-01-26
Posts: 60

Re: [resolved] Can the SQL Expression in "Additional Columns" be dynamically modified

Thanks again.  This worked as well.

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] Can the SQL Expression in "Additional Columns" be dynamically modified

Board footer

Powered by FluxBB