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

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)
28 Replies
Anonymous
Not applicable
Author

The problem I could see is the datatype of column in table is numeric

And when I use globalMap.get(row1.count_group) is not fetching.

I tried writing select * from myTable where columName = CAST(globalMap.get(row1.count_group) AS numeric);

But, the error is not fixed.

Is that the problem due to numeric type, because varchar(string) column types are working fine

 

Thanks,

Meghana

Anonymous
Not applicable
Author

How do I write query..

 

Select * from where myColumn = '" + globalMap.get("something") + "';

Here myColumn is of numeric type.

I hope, If we knew how to write might solve my error.

when I do select '" + globalMap.get("something") + "' from dual, it is showing string '" + globalMap.get("something") + "'

 

Thanks,

Meghana

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
fdenis
Master
Master

problem is: no type are stored in globlMap
you have to define type(java) when you read data

are you still working on error on row1?
Anonymous
Not applicable
Author

Yes still I am working on that.

 

No progress.

 

Actually globalMap.get is not reading data

fdenis
Master
Master

can you give screenshot of your components?
Anonymous
Not applicable
Author

Here it is.

 

 

First of all globalMap is not reading data  from row1


Screen Shot 2018-09-04 at 2.31.31 PM.png
fdenis
Master
Master

and can we also have components detail (querie config ….)?
Anonymous
Not applicable
Author

fdenis
Master
Master

You cannot execute a query containing globalMap value in SQL Editor.
globalMap values are set during job execution.