18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
sql query containing "+" sign
I have a bit of code which has been working for ages where I get the number of rows returned from a database query as shown below
Just a quick update on this I tried to substitute
Donna
var $length;
_set($length, _table($controlName).rows.length);
var $rowCount;
_set($rowCount, adHocQueryMicrosoft("SELECT COUNT = COUNT(*) FROM TABLE_NAME_LOOKUP", "COUNT"));
_assertEqual($length, $rowCount, "The expected number of entries have not been displayed in the DataGrid");
and in my cmd prompt window from where I ran sahi.bat I see that the following code is executedSELECT COUNT = COUNT(*) FROM TABLE_NAME_LOOKUP
however I have a scenario where I need to take into account that my "$controlName" has a header row. So I have created another function withvar $length;
_set($length, _table($controlName).rows.length);
var $rowCount;
_set($rowCount, adHocQueryMicrosoft("SELECT COUNT = COUNT(*) + 1 FROM TABLE_NAME_LOOKUP", "COUNT"));
_assertEqual($length, $rowCount, "The expected number of entries have not been displayed in the DataGrid");
however in my cmd prompt window from where I ran sahi.bat I see the following
SELECT COUNT = COUNT(*) 1 FROM TABLE_NAME_LOOKUP
Any suggestions on how I get the "+" to appear in this command.Just a quick update on this I tried to substitute
_set($rowCount, adHocQueryMicrosoft("SELECT COUNT = COUNT(*) + 1 FROM TABLE_NAME_LOOKUP", "COUNT"));
for
_set($rowCount, adHocQueryMicrosoft("SELECT COUNT = COUNT(*)\u002b1 FROM TABLE_NAME_LOOKUP", "COUNT"));
to insert the unicode equivalent in the string, but this also failed.... the message was successfully displayed on its first iteration in the cmd prompt console as shown:SQL: SELECT COUNT = COUNT(*)+1 FROM TABLE_NAME_LOOKUP
but on the second iteration through it reverted back to being incorrect as shown:SQL: SELECT COUNT = COUNT(*) 1 FROM TABLE_NAME_LOOKUP
CheersDonna
Comments
My new SQL is now
I would prefer to just be able to add/subtract from a value, but at least I can continue with my work.
Cheers
Donna