Forum Discussion

lucky009's avatar
lucky009
New Contributor
12 years ago

Groovy sql script

I have a test suite which encompasses the following. I need to read the data from datasource and load it in DB if the datasource record not in DB. If the datasource.column1 value exists in DB, then stop the script.

1) Read the data from datasource (column 1, column 2)

2) I need to verify the data from datasource exists in DB using groovy script.

def query = "select acct_id from table1 where column1 = <datasource column1>"

If record exists in DB, then stop the script.
Else continue the script .

How to accomplish this using groovy script?

Please advise.

Thanks