What is the best way to execute multi line query?

Hi, I need to grab a number from the website then run it through a multi line query. What is the best way to do this? For example:

result = WebUI.getText('Object')

and then my query

use Table
DECLARE @Id INT
SET @Id = result
DELETE FROM TABLE WHERE USER = @Id

My query is much longer but that’s the gist of it where I need to get the text from the object, then set it as my @Id value and delete it all.

I was looking at executeQuery but it appears I have to condense it all into one line which looks really messy and terrible. What’s the best way I can accomplish this task?

Thank you.

I have to condense it all into one line which looks really messy and terrible

You should use multi-line string syntax of Groovy:

http://groovy-lang.org/syntax.html
4.5 Triple double quotes string

2 Likes