Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have two tables and I need to implement one single condition like this :
set errormode=0;
Emp:
LOAD Name,
ID,
Location
FROM
TestData.xlsx
(ooxml, embedded labels, table is Sheet1);
Std:
LOAD Std_ID,
Class,
Div
FROM
TestData.xlsx
(ooxml, embedded labels, table is Sheet2);
if Scripterror= 11 then
EXIT Script;
ELSE
EXECUTE cmd.exe /c md "A" 2> nul;
EXECUTE cmd.exe /c MOVE /Y "TestData.xlsx" "A\";
But above code will move excel even in one table column structure is changed because of one Excel and two sheets.
what change I need to do in script if one source table got error then it will not move whole excel?
Hi,
If I understand you correctly, may be check for errors after loading each table?
set errormode=0;
Emp:
LOAD Name,
ID,
Location
FROM
TestData.xlsx
(ooxml, embedded labels, table is Sheet1);
IF Scripterror= 11 then
EXIT Script;
ENDIF
Std:
LOAD Std_ID,
Class,
Div
FROM
TestData.xlsx
(ooxml, embedded labels, table is Sheet2);
IF Scripterror= 11 then
EXIT Script;
ELSE
EXECUTE cmd.exe /c md "A" 2> nul;
EXECUTE cmd.exe /c MOVE /Y "TestData.xlsx" "A\";
ENDIF