Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I have implemented section access in my application.
When I execute the script I am facing the error.
The code is given below.
FOR i = 1 to $(vL.Reduction_Field_Count) //Basic for loop using the counter we generated earlier
//Join join our table here as part of the loop and dyunaically build the fieldname based on
//our variables
LEFT JOIN(GROUP_TABLE_temp)
LOAD
ACCESS As Access_1
//,NTNAME As GROUP
,COMBINED_NAME AS NtName_1
,REDUCTION_FIELD_VALUE AS $(vL.Reduction_Field_Name$(i))
RESIDENT SECTION_ACCESS_TEMP
WHERE REDUCTION_FIELD ='$(vL.Reduction_Field_Name$(i))';
//At the sametime on our loop, we'll create some useful fields for later
//to give us the list of different table fieldnames, end datamodel field name
//and field numbers. These will all be used later to dynamically build the end table
REDUCTION_FIELDLIST:
LOAD
'$(vL.Reduction_Field_Name$(i))' AS FIELDLIST
,'$(vL.DataModel_Reduction_Field_Name$(i))' AS DATAMODEL_FIELDLIST
,$(i) AS FIELD_NO
AUTOGENERATE 1;
NEXT i;
DROP TABLE SECTION_ACCESS_TEMP; //Drop no longer needed temp tables
Error which I am facing as below.
2018-02-27 16:38:25 0211 AUTOGENERATE 1
2018-02-27 16:38:25 3 fields found: FIELDLIST, DATAMODEL_FIELDLIST, FIELD_NO,
2018-02-27 16:38:25 2 lines fetched
2018-02-27 16:38:25 0213 NEXT i
2018-02-27 16:38:25 Error: Unexpected token: 'SECTION_ACCESS_TEMP', expected one of: ',', 'AutoGenerate', 'From', 'From_Field', 'Inline', 'Resident', 'Where', ...
2018-02-27 16:38:25 Execution Failed
2018-02-27 16:38:25 Execution finished.
Could you please advice.
Thanks,
SK
Marcus Sommer maybe pcammaert can help
I assume that the loop didn't worked as expected and I would probably use some trace-statements to find where it breaks and how there the content of the variables look like. I mean something like:
trace $(i) - '$(vL.Reduction_Field_Name$(i))';
- Marcus
Aside from the golden tip by Marcus about how to find out what goes wrong during loop execution 3, you can fairly easily reconstruct the code that the script engine tries to parse (and that is giving it a fit). Consider this train of thought:
BTW that's also why Marcus' tip will save your day
P.