Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Ilya_Bobrov
Contributor III
Contributor III

Scripterrorcount doesn’t see an error when data loading from PostgreSQL is broken

Good day!
Faced the problem of the following content:
I set up an incremental load from the Postgre database and everything works, but sometimes the data is not updated. I found out that at some point either the connection is broken, or the application simply does not connect to the database. However, the scriptorrorcount does not see the error. As a result, the variable LastExecTime is updated and a hole appears in the data. Tell me how to be in this situation? Thank you in advance.

Sample of script:

Let ThisExecTime = Timestamp(Now( ),'YYYY-MM-DD hh:mm:ss');
LIB CONNECT TO 'PostgreSQL';

TestQVD:

Load uid, some data,updateddate;
SQL Select uid, some data,updateddate from data_table
where updateddate between '$(LastExecTime ) 'and '$(ThisExecTime )';

Concatenate LOAD

uid, some data,updateddate
FROM [lib://qlik/TestQvd.qvd]
(qvd)
where not exists (uid);

inner join SQL Select uid from data_table;

If scripterrorcount = 0 then
store TestQVD into 'lib://qlik/TestQvd.qvd';
Let LastExecTime = ThisExecTime;
End If;
Drop table TestQVD;

0 Replies