I have one diagram drawing on a database table that has no history.
=> I store the current date and a value in a qvd file every day, thus creating my own.
<=> Every other day, that app produces a "general script error". I cannot spot it.
Can anybody help me here, please?
The code is like this:
// First, I load the "qvd history" that is already there:
Datum_num as Datum_Hist,
// DATE(Datum_Sp_AOS) as %Datum,
// Then I have to find out whether the preceding LOAD from a qvd has returned any records. (If not, I just want to construct a record with the current date and the nr. 0)
LET v_Nr_Rows_Sperr1 = NoOfRows('Sperr1_AOS');
// Next I have a RESIDENT LOAD from this preceding LOAD where I have to take into account this variable that tells me whether anything was found. I have two WHERE clauses because the app now runs all 3 hrs and I want the record for today only once and I want it after 11am - that is about the middle of a working_day, giving me a good approximation of the correct value (the value in the first run at about 3am would be more representative for yesterday)
$(v_today) as Datum_num,
IF($(v_Nr_Rows_Sperr1)<>0, count(DISTINCT BIN_ITEM_DETAIL.ITEM_NUMBER), 0) as Anzahl_Sachnrn
WHERE NOT EXISTS(Datum_Hist, $(v_today))
and Now() > '11:00:00'
It is at this point that the script usually produces a "General script error". I see just now in the log file it says "Misplaced FROM", easy enough - but all the commands are in blue which looks right to me.
Thanks a lot!
P.S.: What's making this all quite confusing is that it seems to me that at some times, the script executes to the end - there is an error in the log, but it doesn't stop there - but the management_console says "Failed".
P.P.S.: One more strange thing - in the error message popup I see when I update manually, that CONCATENATE is visible twice - the same LOAD statement is printed there, immediately followed by a CONCATENATE and the same thing again - I don't have that in the script twice.
It looks like the semicolon was missing - but it is there.