I'm working on our load script and I'm running into a problem. We're implementing incremental load and I've got to call a stored procedure in SQL, but I'm having problems putting the call into an IF ELSE. Here's the code
if $(FirstReload) = true then
SQL EXECUTE EV_TEST;
SQL EXECUTE EV_TEST '$(vExecTime)';
So what I'm seeing is when I run this:
The following error occurred:
Script line error:
The error occurred here:
So I'm not sure if I'm doing something incorrectly with my call to load the stored procedure, or if I have some syntax wrong with my IF ELSE.
Syntax looks fine, your Stored Proc, is the input param mandatory or optional, as there is no param on the first call? Hence the SQL maybe throwing the error .
I've ran both without the IF ELSE and they both successfully run and bring back data. When I run without the param I get a tabled called EXECUTE EV_TEST. When I run it with the param I get a table called EXECUTE EV_TEST '2016-03-10 12:36:50' and that name changes with the timestamp. Both bring back the data I'm expecting and the correct data that correlates to having or not having the parameter.
The input param is optional. We pass nothing over if it's the first time we're loading data and we want to pass the whole set back to qlik. We pass the parameter if it's not the first load so we can get incremental data. I can run both in SQL and both return data to qlik.
Curious. I'm afraid I don't know what's wrong. Can you try it in Qlikview too? Maybe you can generate a log file with more information that way.
Or try replacing one branch of the if statement with some code that can't fail: TRACE $(FirstReload) $(vExecTime);