I am using Karate for my test scenarios for the requirement to update the contract plan by passing the plan Id's and I am retrieving the planId from the database and passing it to my request json.
But the problem I am facing it comes with the column name whereas I only need the value.
Below is the example of how I am fetching my Id by connecting to the database
`@Scenario1 Scenario:
use jdbc to validate
- def config = { username: 'mmultapp', password: 'Mmu1t@pp', url: 'jdbc:db2://edb2dev3.momentum.co.za:60022/MMULTTST', driverClassName: 'com.ibm.db2.jcc.DB2Driver' }
- def DbUtils = Java.type('wellness_core_utils.DbUtils')
- def db = new DbUtils(config)
- def productId = db.readRows('select PRODUCT_ID from MULTUSR1.PLANS order by PLAN_ID desc fetch first 1 rows only')
- print productId`
And I am getting the results in this way
{
"PRODUCT_ID": 68
}
I only need to read the value of 68 so I that I can pass it to my json request
Thanks in advance