Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm facing the issue with below script reload:
LET vs_ETL_Rows = 2;
R:
LOAD * INLINE [
Col1, Col2
A, 1
B, 2
];
for vVar=1 to 2
sections:
NoConcatenate
LOAD * resident R
where [Col1] = $(vVar);
Next
For vVar = 1 to ($(vs_ETL_Rows)-1)
Join(sections)
Load * Resident "sections-$(vVar)";
NExt
Reload return the error:
ScriptErrorCount 1
ScriptErrorDetails Table 'sections-1' not found
ScriptErrorList Table Not Found
ScriptError Table Not Found
Could you please help me to fix this issue.
Hi @PaulinaWanago ,
_______________________________________________________
LET vs_ETL_Rows = 2;
R:
LOAD * INLINE [
Col1, Col2
A, 1
B, 2
];
for vVar=1 to 2
sections:
NoConcatenate
LOAD * resident R
where [Col1] = $(vVar);
NEXT
EXIT SCRIPT // load only the first part of script
For vVar = 1 to ($(vs_ETL_Rows)-1)
Join(sections)
Load * Resident "sections-$(vVar)";
NExt
_____________________________________________________________
When you only load the first part, you can see the table sections-1 doesn't exist (take a look on you model).
I don't know what you want to do exactly, so i can really suggest adjustments.
Regards.
It's no problem to include the loop-iterator or an appropriate referenced value into a load-logic but you need to include the iterator-information nearly everywhere - by defining the table, the source, any kind of where-clause as well as the store/drop-stamentes, like:
...
for vVar=1 to 2
[sections-S(vVar)]:
NoConcatenate LOAD * resident R where [Col1] = $(vVar);
...
Beside this be aware that using join-operations within loops could become tricky - if for example the added fields from the first iteration becomes key-fields in the following ones ...
Hi Marcus,
It make sense but with [sections-S(vVar)]: also script reply error - 'Table 'sections' not found.
Thanks Sbaro, looks like it works. Will try in big script.
But EXIT SCRIPT finish the reloads, what if script should run and execute next part of the script?
You need to apply it everywhere - any you may have missed anyone, maybe within the join-reference.
Looking within the document-log will show the exact place of which iteration where the error happens. A shortcut in the above example may be just to search per CTRL + F for the term sections.