Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
BN1
Contributor II
Contributor II

I want to extract the values of few fields from tExtractJSONFields and update a Database record

I want to extract the values of few fields from tExtractJSONFields and update a Database record. I can see the extracted values through tLogRow.

I can create an intermediate excel file with the extracted values and update a DB record, but don't want handle an intermediate file.Instead would like to get the values in context or global variable or something else and update a record in database.

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable

input_row is the fixed prefix on tJavarow, change it to
context.batchid =input_row.batchid;

View solution in original post

6 Replies
Anonymous
Not applicable

Hi BN
If you want to store the value in a context variable or global variable temporarily and use it later, do it on tJavaRow, eg:
...tExtractJsonField--main--tJavaRow
-onsubjobok--other subjobs
on tjavaRow:
context.value=input_row.columnName;
or
globalMap.put("key",input_row.columnName);

Regards
Shong
BN1
Contributor II
Contributor II
Author

Thanks for your response.

What would be input_row in my case, I tried, Getting an error. Attached the screenshots. 


Talend_Comm1.docx
Anonymous
Not applicable

I suggest to use tJavaRow to store the value to context variable for used later, but I don't see it in your job.
It is a compilation error, open the Code tab, you will see which line / which component has the error.
BN1
Contributor II
Contributor II
Author

Earlier I was defining global variable and now I did it with context variable.

The problem is in the fact that it is not able to get the input_row variable.

I am getting error in the line:

context.batchid = row2.batchid;

I had attached the steps and error in the previous and as well as this post.

In my case what would be input_row.This might sound like a basic Qs.


Talend_Comm2.docx
BN1
Contributor II
Contributor II
Author

Earlier I was defining global variable and now I did it with context variable.

The problem is in the fact that it is not able to get the input_row variable.

I am getting error in the line:

context.batchid = row2.batchid;

I had attached the steps and error in the previous and as well as this post.

In my case what would be input_row.This might sound like a basic Qs.


Talend_Comm2.docx
Talend_Comm2.docx
Anonymous
Not applicable

input_row is the fixed prefix on tJavarow, change it to
context.batchid =input_row.batchid;