Groovy's Sql broken after update to Ready API 3.1
I have a Test Case where I need to first insert a row into an Oracle DB and then I need to do something with it. To solve that I have used a Groovy script Test Step to insert a row using groovy.sql.Sql class and then retrieve the autogenerated column.
In Ready API 3.0 this worked:
import groovy.sql.Sql def driver = 'oracle.jdbc.driver.OracleDriver' com.eviware.soapui.support.GroovyUtils.registerJdbcDriver( driver ) def col = null Sql.withInstance('what', 'ev', 'er', driver) { sql -> //below values are not really important, we just need some data def val1 = 1 def val2 = 2 String[] keys = ["COL"] def result = sql.executeInsert ("""insert into MY_TABLE (COL1, COL2) values ($val1 , $val2)""", keys) col = result[0].COL log.info("Inserted row with col=$col") }
assert col != null return col
However in Ready API 3.1 this gives me an error. After many tries I could not figure out how to do an insert with parameters and specifying column names to return. None of the overloads of executeInsert method worked. So I think it is a BUG that this code does not work in Ready API 3.1.
Is there any other suggested method of inserting rows into DB and retrieving values of columns generated by the DB ?
Thank you richie!
Hi dejvid-smth, have you managed to solve this? Do let us know:smileyhappy:
We can try to continue the investigaion here if it is still an issue - I see that richie requested additional clarifications from you.
Also, this might be a good idea to contact Support and describe the issue to them in detail.