I am calling a karate DButil to execute one of the database query in the karate script:
* def test = db.readValue('SELECT * FROM CLIENT C WHERE C.ClientCode = ' + globalAccountID)
Here i', unable to convert the globalAccountID to string. Please help on this.
My error trace is below:
javascript evaluation failed: db.readRows('SELECT * FROM CLIENT C WHERE C.ClientCode = ' + globalAccountID), StatementCallback; uncategorized SQLException for SQL [SELECT * FROM CLIENT C WHERE C.ClientCode = 707]; SQL state [S0001]; error code [245]; Conversion failed when converting the varchar value 'YTLQVLBK' to data type int.; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting the varchar value 'YTLQVLBK' to data type int.