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: 
Not applicable

About delete

Hi All,

The following code is from help about deleting records. But why do we use "If ScriptErrorCount = 0 then " clause, what's the meaning of it?

Let ThisExecTime = Now( );

QV_Table:

SQL SELECT PrimaryKey, X, Y FROM DB_TABLE

WHERE ModificationTime >= #$(LastExecTime)#

AND ModificationTime < #$(ThisExecTime)#;

Concatenate LOAD PrimaryKey, X, Y FROM File.QVD

WHERE NOT EXISTS(PrimaryKey);

Inner Join SQL SELECT PrimaryKey FROM DB_TABLE;

If ScriptErrorCount = 0 then

STORE QV_Table INTO File.QVD;

Let LastExecTime = ThisExecTime;

End If

1 Solution

Accepted Solutions
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

The meaning is that all the SQL and LOAD statements above were successfully executed with no errors. You don't want to override a "good" QVD file with potentially "Bad" data if something went wrong.

View solution in original post

4 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

The meaning is that all the SQL and LOAD statements above were successfully executed with no errors. You don't want to override a "good" QVD file with potentially "Bad" data if something went wrong.

Not applicable
Author

Hi,

Thanks for your reply, does it mean we should always use this clause before overriding the QVD?

Isaac Li

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

I'm not sure if everyone is always using it, but it does look like a good practice, especially if SQL or ODBC errors are frequent.

Not applicable
Author

Hi,

During the execution of script the number of statements caused error will be retured by this statement. You are able to find this when you will open your Qv log file.

Regards,

Ravi