Search code examples
talend

Talend save Oracle Sequence number to context variable


I've the following problem: I want to get the next sequence number from Oracle and save it into my context variable.

I have a working tOracleInput_1 (tLogRow shows correct output:)

.-------------------.
|#1. tLogRow_1--tLogRow_1|
+----------+--------+
| key      | value  |
+----------+--------+
| datei_id | 264032 |
+----------+--------+

Now I'd like to write this value ('datei_id') to 'context.dateiId'. For this I've made a main-row to tJava and in tJava:

context.dateiId = ((String)globalMap.get("tOracleInput.datei_id"));

The value of context.dateiId is now

null

Can anyone help me with this issue?


Solution

  • use tJavaRow in place of tJava and inside it use context.dateiId = input_row.schemacolumnName; where schemacolumnName is your column name from tOracleInput schema which is mapped to tJavaRow via main flow