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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

insert a row with context variables

Hello everyone,

 

I have some context variables that I need to put in a database so that at each execution of the job a new row is created with these variables. I'm not sure if I'm using it right but with a

tMSSqlconnection ==(On component OK)==> tMSSqlrow ==(Main)==> tMSSqloutput 

there is no new line in my database .

 

the query in my tMSSqlrow ;

INSERT INTO table1 (col1, col2, col3) values (StringHandling.SQUOTE(context.var1) ,CONVERT(DATETIME, StringHandling.SQUOTE(context.var2), 20), StringHandling.SQUOTE(context.var3))

 

I'm I doing something wrong ?

 

 

Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

3 Replies
Anonymous
Not applicable
Author

did you commit

tnewbie
Creator II
Creator II

tFixedFlowInput would do the job...please check the attachment


capture_contexts_in_DB.png
vapukov
Master II
Master II

Hi,

 

you need prepare sql by concatenating string:

"INSERT INTO table1 (col1, col2, col3) values ("+StringHandling.SQUOTE(context.var1)+",CONVERT(DATETIME, "+StringHandling.SQUOTE(context.var2)+", 20), "+StringHandling.SQUOTE(context.var3)+")"