Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am facing some issue in the below load script:
test:
load *,
NoOfRows('TESTMain') as CountNO
Resident TESTMain;
Drop Table TESTMain;
Let vTest = peek('CountNO',0,'test')
if($(vCount)>0) Then
EXIT Script
Endif
I am getting script line error message in below lines
(if(>0) Then) ,
endif.
I am checking for null condition but not sure why the variable vTest does not returns any value.
Thanks in advance!!
Rohit
Have you checked the variable content in script debugger or with a TRACE?
Note that you don't need dollar sign expansion in the IF statement:
IF vTEST > 0 THEN
Exit script; // don't forget the semicolon...
END IF // I believe it's written that way
Maybe just use the variable vTest instead of vCount?
IF vTest >0 THEN
Hi Stefan,
It was a typo. I use the same but it not giving any value. It gives error message as stated in my earlier note.
Thanks,
Rohit
Please post the exact script snippet content. There is easily a semicolon missing if you type it manually, e.g. after exit script:
Exit script;
In total, I think you just need
IF NoOfRows('TESTMain') >0 THEN
Exit script;
END IF
seems like you are missing semicolon
Let vTest = peek('CountNO',0,'test') ;
Hi,
I am redefine my load script but it is giving me error in IF condition i.e. if($(vTest)>0) .
test:
load *,
NoOfRows('TESTMain') as CountNO
Resident TESTMain;
Drop Table TESTMain;
Let vTest = peek('CountNO',0,'test')
if($(vTest)>0) Then
EXIT Script
endif
Thanks,
Rohit
Have you checked the variable content in script debugger or with a TRACE?
Note that you don't need dollar sign expansion in the IF statement:
IF vTEST > 0 THEN
Exit script; // don't forget the semicolon...
END IF // I believe it's written that way
I normally use the NoOfRows() function to get the number of rows in a table directly.
Let vNoOfRows = NoOfRows('SalesTable');
Let vNoOfQVDRows = QvdNoOfRecords('QVD_SalesTable.qvd');
It's faster to execute and easier to maintain.
PFA
seems to be working without an error
Thanks Stefan.
Condition work fine.
Just one more thing does variable vTEST return NULL or give some numeric data.
Thanks,
Rohit