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;