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.
Getting error ( invalid identifier) when I am trying to pass variable in SQL Query through SAHI
Here is my details-
$AAA = 9015066384
var $db = _getDB( db connection);
var $Data = "SELECT * FROM table WHERE XXX =" + $YYY; (when I use _alert function to see the value in the YYY variable then I can see the correct value there)
var $rscom1 = $db.select($Data);
Then I am trying the value with the DB value.
_assertEqual($AAA , $rscom1[0]["ZZZ"]);
But getting below error-
error- exception: java.sql.SQLSyntaxErrorException: ORA-00904: "FBEU00001IHQ": invalid identifier
FBEU00001IHQ this is the value for $YYY
$AAA = 9015066384
var $db = _getDB( db connection);
var $Data = "SELECT * FROM table WHERE XXX =" + $YYY; (when I use _alert function to see the value in the YYY variable then I can see the correct value there)
var $rscom1 = $db.select($Data);
Then I am trying the value with the DB value.
_assertEqual($AAA , $rscom1[0]["ZZZ"]);
But getting below error-
error- exception: java.sql.SQLSyntaxErrorException: ORA-00904: "FBEU00001IHQ": invalid identifier
FBEU00001IHQ this is the value for $YYY
Answers
I think passing the variable $YYY in single quotes should solve the problem that you're facing.
Regards.