Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I try to know how I can call a function.
ex:
I make a table:
LOAD
*
FROM
Documents
and now I want to use this table in each other table I have without copy/past. Until now I put this table into a variable and I wonder if is it work.
Regards
One addition, maybe it's better to remove the COUNTRY_CODE and put the tablename or something similar within these error-load and use an autogenerate 1;
- Marcus
I see what you are trying to do and I think it's very clever.
You can use either the $(vError); approach as Marcus suggested or an $(incude).
If using the $(include), be careful that there are no statements in the include before that LOAD, as that would reset the *Error variables..
I think you should also remove the CONCATENATE and just rely on auto concatenation. Then you won't have to pre-create the table.
-Rob
Hi Marcus!
Thanks for your help.
I tried your answer and I got a problem. Do you know why my errors are reset? They are all at NULL and 0
REgards
Thanks for your help.
I always get the same error. All my Error variable turn NULL when I use $(vError) and when I put my all error script next to my table I get everything I need. If you have a idea I take it!
Regards
Thanks for your help,
I try what you sent to me, but the result is NULL after my table. I wonder if this call function doesn't reset my error varible.
Please post an example (not your original - a small dummy with a few inline-tables).
- Marcus
<//include-file:
let vLoadTable = TableName(NoOfTables() - 1);
CONCATENATE(ERROR)
LOAD
//COUNTRY_CODE,
'$(NbRows)' as NB_ROWS,
'$(ScriptErrorCount)' as ERROR_SEQ_NUMBER,
'$(#ScriptError)' as ERROR_ID,
'$(ScriptError)' as ERROR_NAME,
'$(ScriptErrorDetails)' as ERROR_DETAIL,
'$(ScriptErrorList)' as ERROR_LIST,
now() as ERROR_DATE
resident $(vLoadTable);
/**************************************/
MaxString(AC) AS "GENERIC_1", | |
MaxString(AD) AS "GENERIC_2", | |
MaxString(AE) AS "GENERIC_3", | |
MaxString(AF) AS "GENERIC_4", | |
MaxString(AG) AS "GENERIC_5", | |
count('*') AS "NB_OF_DUPLICATED" | |
FROM | |
[ftp://$(AAA):$(AAA)@$(PATH_ADDRESS)/$(vDirectory)/Prospect.xlsx] | |
(ooxml, no labels, header is 1 lines, table is DATA) | |
where (Len("A") > 0) | |
Group By A, B, '$(vCountry)'; | |
STORE Datas Into | |
$(include=$(vLoadTable)); | |
/******************************************************************************************/
Result:
Insert the code as Marcus suggested, with
$(vError);
that should work. If it doesn't ,please post the script you are using.
-Rob
The LET statement will reset your error variables.
-Rob
The CALL will reset the Error variable.
-Rob