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

Then how should I achieve this job..

I wanted first query result as input for second query.

fdenis
Master
Master

you cannot execute the query directly into SQL editor because it's a dynamic query. it is generated when the globalMap value is set.

But you can write or copy your query into component query field.
Query fiels is a Java String you have to quote your query.
"select ….. from …. where xxx=" + globalMap.get("toto") +" and …"
Anonymous
Not applicable
Author

I did keeping query in component and also I run the entire job, but I am getting same error at the second DB component

fdenis
Master
Master

show me the error screen.
show me your query in Component form.
Anonymous
Not applicable
Author

Exception in component tDBInput_3 (SamplePost2)

org.postgresql.util.PSQLException: ERROR: invalid input syntax for type numeric: "" + (BigDecimal)globalMap.get("row1.system_user_id") + ""

at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)

at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)

at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)

at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)

at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:336)

at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:235)

at local_project.samplepost2_0_1.SamplePost2.tDBInput_1Process(SamplePost2.java:1434)

at local_project.samplepost2_0_1.SamplePost2.runJobInTOS(SamplePost2.java:2087)

at local_project.samplepost2_0_1.SamplePost2.main(SamplePost2.java:1930)

[statistics] disconnected

 

this is error when I run

 

attached query in component


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

remove all \ into your query.
Anonymous
Not applicable
Author

Thanks a lot for spending time

 

The issue got resolved..

 

fdenis
Master
Master

Tag as "solved" the reply who help you. it may help other peoples who have the same problem.
sea you!
fdenis
Master
Master

see you!!!!