Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
INESBK
Creator
Creator

Use of a tmap field in a query for tMsSqlInput

Hi,

I would use a field that exist in tmap to use it with query in tMsSqlInput like this 

"select * from Table
where name="+row1.name

But when i run the job I get this error

 

0683p000009Lum3.png

Can you help me please ?

Thanks in advance.

 
Labels (2)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

It depends.

If most of the rows from main flow are linked with just few rows from the lookup, it should be efficient to use "Reload at each time (cache)" option to get only the required rows from database. Of course, columns used as criteria are supposed to be indexed on database side.

Else, if each row from main flow is linked with a different rows from the lookup you'll have to load all the rows from the lookup table, so "Load once" is the option in such a case.

View solution in original post

14 Replies
TRF
Champion II
Champion II

Hi,
First, because the name column is a string, the exact syntax should be:
"select * from Table
where name='"+row1.name+"'"
Is it enough to solve your problem? Not sure but you have to share your job design for a better answer.
INESBK
Creator
Creator
Author

Thank you for your replay but it doesn't solve the problem.

0683p000009Luxs.png0683p000009Luy7.png

TRF
Champion II
Champion II

Now you have a new problem, it's a compilation error.

Click on "Code" tab and go to line 4103 to get the exact compilation error.

TRF
Champion II
Champion II

Also share tMap_3

INESBK
Creator
Creator
Author

0683p000009LuyC.png0683p000009LuRV.png0683p000009Luk6.png

With error S connot be resolved to a variable ! 

TRF
Champion II
Champion II

It seems the error is not there. Move the mouse pointer on the little red rectangle in the right marging, a popup should give you the message

INESBK
Creator
Creator
Author

0683p000009LuXI.png

TRF
Champion II
Champion II

OK, you cannot use S.name in the SQL query as it not a known field in this component.

Do you use "Reload each time" as the Lookup Model in tMap_3?

This is the way to do what you expect (I think so).

Refer to this document for details.

INESBK
Creator
Creator
Author

In fact, my need is to compare the contents of each incoming file by the lines in the database through the name to lighten the memory...