Six Stars

Setting a context variable with a value contains one ROW of database using tJava

How to set Context Variable from tMap which fetches the Row.File_name from databse such that  i can use that Context Variable in tFileInputExcel as a File Name 

 

ScreenShot of Problem has been Shared BelowCapture.PNGWant to set row1.file_Name in Context VariableCapture.PNGOutPut contains File Name and Date want to set FileName as Context Variable such that i can use that fileName in any component 

OutPut contains File Name and Date want to set FileName as Context Variable such that i can use that fileName in any component

4 ACCEPTED SOLUTIONS

Accepted Solutions
Seven Stars

Re: Setting a context variable with a value contains one ROW of database using tJava

Hi,

After tMap use tJavaRow here, In tJavaRow use below code -
context.filename = <row>.filename
This code will set the value in context variable, then using OnSubJobOk, you can use this variable to read file.

Best Regards,
Abhishek
Twelve Stars

Re: Setting a context variable with a value contains one ROW of database using tJava

@meetmahajan Transfer field should be created in context tab with sting type.

Manohar B
Twelve Stars

Re: Setting a context variable with a value contains one ROW of database using tJava

@meetmahajan,you can create belwo way also.

Untitled.png

Manohar B
Twelve Stars

Re: Setting a context variable with a value contains one ROW of database using tJava

@meetmahajan,context load.Transfer field should be created in context tab with sting type.

 Untitled.png

 

Manohar B
12 REPLIES
Twelve Stars

Re: Setting a context variable with a value contains one ROW of database using tJava

Seven Stars

Re: Setting a context variable with a value contains one ROW of database using tJava

Hi,

After tMap use tJavaRow here, In tJavaRow use below code -
context.filename = <row>.filename
This code will set the value in context variable, then using OnSubJobOk, you can use this variable to read file.

Best Regards,
Abhishek
Six Stars

Re: Setting a context variable with a value contains one ROW of database using tJava

@manodwhb
How can i set row1.file_name in tContextLoad
there is no field in which i can set key and value
Six Stars

Re: Setting a context variable with a value contains one ROW of database using tJava

This is not Working !!
@abhishek
Seven Stars

Re: Setting a context variable with a value contains one ROW of database using tJava

Could you please provide a screenshot how are you using it
OR
Where is it failing ?

Best Regards,
Abhishek
Twelve Stars

Re: Setting a context variable with a value contains one ROW of database using tJava

@meetmahajan,you should get only one field into tlog that filename

Manohar B
Six Stars

Re: Setting a context variable with a value contains one ROW of database using tJava

Twelve Stars

Re: Setting a context variable with a value contains one ROW of database using tJava

@meetmahajan Transfer field should be created in context tab with sting type.

Manohar B
Six Stars

Re: Setting a context variable with a value contains one ROW of database using tJava

@manodwhb

Still getting an error 

in tLogRow there is only one field row1.File_Name

Screenshot (43).png

Twelve Stars

Re: Setting a context variable with a value contains one ROW of database using tJava

@meetmahajan,you can create belwo way also.

Untitled.png

Manohar B
Twelve Stars

Re: Setting a context variable with a value contains one ROW of database using tJava

@meetmahajan,context load.Transfer field should be created in context tab with sting type.

 Untitled.png

 

Manohar B
Six Stars

Re: Setting a context variable with a value contains one ROW of database using tJava

Thank You so Much @manodwhb, for your Precious guidance, it worked properly.

Thank @abhishek for solution Smiley Happy