Is there a way to fetch string value from MySQL database through Karate

25
January 13, 2019, at 06:30 AM

I am having an issue while karate fetches a string value from MySQL db. readValue works fine if it is string value it fetches from db but getting error like Unknown column 'SMEMSD22' in 'where clause' How to deal with alphanumeric data with karate. Any help would be appreciated.

I tried using below to fetch the value from database:

def DbUtils = Java.type('testRunner.DbUtils')
def db1 = new DbUtils(config)
def data = db1.readValue('select bp.value  from table1 wd inner join table2 bp on wd.val=bp.val where wd.ordernumber = '+webOrder+' and wd.boxid= '+id+' order by column 1 desc limit 1;')

I am feeding webOrder and id as variables in the above query which I am getting from readValue() method which karate gives by default. The issue is only with id because the value what it fetches is alphanumeric. The above query works fine with the integer.

I tried converting data to a string and then using it further but met with the same error.

READ ALSO
Column count doesn't match value count at row 1 in MySQL

Column count doesn't match value count at row 1 in MySQL

I have created a table with the following query:

16
How to mirror mysql database traffic to another server

How to mirror mysql database traffic to another server

I have two server Mysql database in Cent OS 7Server A(192

20
How to calculate time diffrence in mysql

How to calculate time diffrence in mysql

I am storing the user activity in the table by start and end time , now i want to calculate how much overall time a user spends under each subject

19
Supress information in mysql prompt

Supress information in mysql prompt

I ran the query in mysql prompt , I need to supress the "1 row in set (000 sec)" in output prompt

11