Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Error when passing global map parameter in sql query

Hi

 

I have created a job like

 

DBInput---> row1(main)--->tFlowIterate-->DBinput

I wanted to use the result of first query as input parameter to the second query.

I posted the schema of first schema column and the second schema query is like

SELECT * FROM myTable where COUNT(1) = " + ((Integer)globalMap.get("row1.count_group")) + ");

 

Getting error as:  Error near row1

 

Can anyone help me out what am I missing?

 

Thanks in advance,

 

Meghana. 

Labels (2)
1 Solution

Accepted Solutions
fdenis
Master
Master

globalMap.get(row1.count_group) is wrong
return return globalMap value named as the value of row1.count_group.

globalMap.get("row1.count_group") is good
return return globalMap value named row1.count_group.

just try inserting a number into the query.
then if it work replace the nuer by " + thenumber + "
then if it work replace the nuer by " + ((Intger)globalMap.get("row1.count_group")) + "

row1.count_group must be defined as Integer allow null in row1.
Regards

View solution in original post

28 Replies
fdenis
Master
Master

"SELECT * FROM myTable where COUNT(1) = " + (String)((Integer)globalMap.get("row1.count_group")) + ")"
with " and without ;
TRF
Champion II
Champion II

Should be like this:
"SELECT * FROM myTable where COUNT(1) = " + ((Integer)globalMap.get("row1.count_group"));

Double quote at the beginning, not ) at the end
Anonymous
Not applicable
Author

It's not working, still I am getting same error.

select * from "employee_detail" where age = '"+((String)globalMap.get("row1.system_user_id"))+"' 

The above query I used for another job and it worked fine. 

But, I am getting error for this job as I mentioned before.

 

Thanks,

Meghana.

 

Anonymous
Not applicable
Author

I am still getting error

 

fdenis
Master
Master

can you show us your error message.
Anonymous
Not applicable
Author

fdenis
Master
Master

and your component configuration!
Anonymous
Not applicable
Author

Configuration of which component first db or second db

fdenis
Master
Master

the one who is red or booth!