Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can someone please tell me what is wrong in the below code?
When i run the load of Table2 without if loop, it loads fine. However, when i run it inside IF loop, load does not happen, although Table2.qvd already exists in the specified path.
Let vSource='C:\Users\Punit\Desktop\';
LET vTable='Table2.qvd';
If (NOT IsNull($(vSource)$(vTable))) then
LOAD MRPDetails,
MRPEN,
WW_Vendor_No,
Date,
Quantity
FROM
[$(vSource)Table2.qvd]
(qvd);
ENDIF;
Try this:
SET vSource = 'C:\Users\Punit\Desktop\Table2.qvd';
LET vExist = If(FileSize(vSource)> 0, -1, 0);
IF $(vExist) then
LOAD MRPDetails,
MRPEN,
WW_Vendor_No,
Date,
Quantity
FROM
[$(vSource)Table2.qvd]
(qvd);
ENDIF;
Try this:
SET vSource = 'C:\Users\Punit\Desktop\Table2.qvd';
LET vExist = If(FileSize(vSource)> 0, -1, 0);
IF $(vExist) then
LOAD MRPDetails,
MRPEN,
WW_Vendor_No,
Date,
Quantity
FROM
[$(vSource)Table2.qvd]
(qvd);
ENDIF;
Try using single quotes in ISNULL function
Let vSource='C:\Users\Punit\Desktop\';
LET vTable='Table2.qvd';
If (NOT IsNull('$(vSource)$(vTable)')) then
LOAD MRPDetails,
MRPEN,
WW_Vendor_No,
Date,
Quantity
FROM
[$(vSource)Table2.qvd]
(qvd);
ENDIF;
Thanks.Both the solutions work for me.