Update SQL table using Katalon Studio

read

#1

Hello guys,

I am trying to use UPDATE query, for that I have defined:
SQLHandler_TestDB sql = new SQLHandler_TestDB()
List update = sql.getSelectResults(“UPDATE DBTest SET DESCRIP = DESCRIP …”).

it gives me an error and it says that the statement did not return a result set. Well I know that it did not returned any result, because it is an update. But what kind of keyword should i use for only updating ?
It works well with select query.


#2

Hello,

I think you are using a method only for selecting rows (inside getSelectResults; sql.rows() probably). Use execute() for other operations like insert, update, delete and so on.

This article may be helpful:
http://grails.asia/groovy-sql-update-operation-examples


#3

Thanks Marek, according to your link, I have added this class into my SQLHandler and now it works fine !

public void updateResult(String args) {
	def some = sql.execute(args)
}