Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ioannagr
Creator III
Creator III

error code -129 while loading script

Hello all,

I've been getting this error code since the morning,

 

 

2021-03-26_13-15-41.png

What is it? Should i restart the server?

6 Replies
rubenmarin

H, it will be better if you post the part of the scrit giving that error, maybe you have a variable that hasn't been initialized or is not calcualted the way you want.

ioannagr
Creator III
Creator III
Author

Hi @rubenmarin yes of course. I should say that this happens in a try of doing incremental load (insert, update and delete), that my source table doesn't have a timefield on its own but as long as it always exists with another qvd in the app it takes it from it in the where clause part as you will see, BUT  please note that the error code doesn't  happen if i load part of the data. Please take a look.

incremental_load:

Load id as Alias, state 

sql select  a.id, a.state,a.id2,b.updated from sourcetable1 a

inner join sourcetable2  b on a.id2=b.id where b.updated>='$(Last_Update)';

 

Concatenate
Load * from [$(vPathQVD)/Initial.qvd] (qvd)
WHERE NOT Exists(id);

Inner Join

SQLselect  a.id, a.state,a.id2,b.updated from sourcetable1 a

inner join sourcetable2  b on a.id2=b.id;

---

EDIT: This error occurs also when i add this part after concatenate:

inner join

SQLselect  a.id  from sourcetable1 a

inner join sourcetable2  b on a.id2=b.id;

 

ioannagr
Creator III
Creator III
Author

What i did to solve this was to  add to the last inner join part:

inner join

SQL select  a.id as Alias from sourcetable1 a

inner join sourcetable2  b on a.id2=b.id;

 

 

it seemed to do the work for a reason. 🤔

rubenmarin

Hi maybe it was beacuse it was creating duplicates and the result table grows too much.

Note that you also have a sentence like "WHERE NOT Exists(id)" and this id field isn't loaded, it is loaded as 'Alias', so probably all records from the qvd are loaded each time the script is executed.

Also I would reccomend to use a LOAD sentence before SQL, and use this LOAD to rename fields.

So at the end, the script to work may be something like:

incremental_load:
Load id as Alias, state;
sql select  a.id, a.state,a.id2,b.updated from sourcetable1 a
inner join sourcetable2  b on a.id2=b.id where b.updated>='$(Last_Update)';

Concatenate
Load * from [$(vPathQVD)/Initial.qvd] (qvd)
WHERE NOT Exists(Alias);

Inner Join
Load id as Alias, state;
SQLselect  a.id, a.state,a.id2,b.updated from sourcetable1 a
inner join sourcetable2  b on a.id2=b.id;

 Another thing is that the last sql sentence loads the same fields than the first one, but without filtering by date. So there is no use for incremetnal load if at the end you need to do a select that retrieves all records. Just retrieve all records on the first sentence.

It only has a use if the first SQL retrieves many other fields that the last one.

ioannagr
Creator III
Creator III
Author

Hi @rubenmarin , i don't undestand what you say ( "Another thing is that the last sql sentence loads the same fields than the first one, but without filtering by date. So there is no use for incremetnal load if at the end you need to do a select that retrieves all records. Just retrieve all records on the first sentence".)

because i see you didn't correct anything on my last sql code?

 

rubenmarin

Hi, that last join is usually used to control deleted rows, to remove them also from qvd.

And this las sentence will load all the unique keys, if you are using id and state I think that is beacuse there are id's that can be repeated by state so you need to load both to create the unique key, and in this case, if you only need these two fields as data, there is no advantage of using incremental load because you always need to load all these values.

In the corrected anwser you only use 'id', if this field alone is the unique key at least in the last sentece you can avoid the use of 'state' and other fields, gibving you that advantage: as in this case you don't need to load all fields in every load, just the id.

Also note that I did a change, and it was in the Exists() function, using 'Alias' (the name as the field is loaded) instead of 'id'.