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: 
Anonymous
Not applicable

assign tMSSqlRow value to context variable?

Hi,

 

 

how to assign tMSSqlRow value to context variable ?

 

Below is my query is written in tMSSqlRow_2. Need to read the value from tMSSqlRow_2 and assign to context variable. how to achieve this?  Please help

 

Query :

"
begin
declare
@srcid int,
@sessionid int;

select @srcid=srcid from dbo.src_tbl where src_name='xxx';

select sessionid from session_tbl where srcid=@srcid and loaddate='2011-12-20'
end
"

 

 

Additional info:

session_tble structure:
sessionid int IDENTITY(-3333333,1) not null ,
srcid int,
loaddate date

 

src_tbl structure:

src_id int,
src_name varchar(500)

 

Context:

Name          Type    Value (default)

SessionID    Int        -9999999

 

i have followed this :

tMSSqlConnection -->tMSSqlRow_1  --OnComponentOK---> tMSSqlRow_2  ---main--->tJavaRow-->tLogRow 

 

i have written above code in tMSSqlRow_2, in tMSSqlRow_1  ("sessionid")  is getting populated.

 

When i run job it is writtening null.

 

Please help.

 

 

Thanks

Labels (3)
2 Replies
TRF
Champion II
Champion II

Hi,
What's in tJavaRow?
Anonymous
Not applicable
Author

Can I ask why you are using the tMSSqlRow for this? From what I have seen of your problem, it would be a lot more straight forward to use the tMSSqlInput to read the data and the tMSSqlOutput to write the data.