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

how to with tMap to define constants

Hello everbody,

I'm in front off a problem that I don't find how to solve to: I'm fetchning from an oracle database a field value. this value must be updated in an mysql database throw an update with two constants in a where row: UPDATE my_table SET my_field = oraclevalue WHERE field = 'firstField' AND secondField = 'secondField';
So my batch is based like the following one:

But from and to field are not variables but must be static values. How can I define their values ? Does I need to update the model? Does I need to update job to fetch the row matching from Mysql Database server and update it?
Best
Labels (4)
14 Replies
Anonymous
Not applicable
Author

Hi,

your image is not linked

you can use a look up (small file delimited) with and dooble inner join
or create global variables in a tJava / tSetGloblavariable and use filter the output
or create two context variable and use filteron the output.

some idea

Jeremie
Anonymous
Not applicable
Author

If you are using external image provider you may block out people from helping you. Some companies have extreme restrictive firewall rules. I can not get your picture if you don?t attach them to your post.
If you need a constant value you can use a global variable. A global variable, you can set from any place in your job (like with tPrejob) and then use in your tMap. I?m usually using a context Variable for global Variables because I like the CTRL+Space functionality.
Anonymous
Not applicable
Author

please accept my apologises for picture, I have post a bad link url.
Anonymous
Not applicable
Author

Hello,
thanks for your feedback.
So I have add a t_SetGlobalVar with two variables: Var1 with value firstField, Var2 with value secondField.
But I'm sorry but can't found how to use them in t_Map?
0683p000009M9p6.png
Best regards
Anonymous
Not applicable
Author

You can use with ctrl+space in the expression builder (clic on the ...)

jeremie
Anonymous
Not applicable
Author

hello,
thanks for yours feedback.
So I have used them like this, but I'm not sure that syntax is wrong because CTRL+space doesn't give me my variables in list.
The job contains now a t_SetGlobalVar which have two variables definitions.

In My Map, I have update the variables with CTRL+Space

But when I run job, I have an error that mapping fields cannot be null.
So, My mapping is wrong, I suppose that my variables declarations is wrong, but I can't see why.
Does someone can help a newbie? 0683p000009MACn.png
Best regards
Anonymous
Not applicable
Author

I don't no, I think it's the schema of your data
Perhaps put an onsubjobOk after the tSetGlobalVariables

Jeremie
Anonymous
Not applicable
Author

As I said, if you don?t attach the picture to the post, I will not be able see them. If variables are not available, then you did not declare them before.
Anonymous
Not applicable
Author

Well,
I have put a subjobok on the variable declaration, but variables are always unavailable in the tMap.
Here's a screenshot.