Question: I'm trying to set the value of a variable to the result of a simple select statement.

```
var datevar varchar(10);
exec :datevar := SELECT trunc(sysdate) from dual;
select :datevar ASOF from dual

```

I get the error message below. I'm working with Oracle 12c

[![enter image description here](https://i.stack.imgur.com/lgUQt.jpg)](https://i.stack.imgur.com/lgUQt.jpg)

How can I get this to work without using PL/SQL? Thanks

Answer: 
You can create shuch kind of method, and pass argument text to click on the needed element

```
public void clickOnButton(String text){
       WebElement button = driver.findElement(By.xpath("//label[text() = '"+text+"']")); 
       button.click();
      }

```
Just use `String.format()`

So you want something like this:

`String selector = "//label[text()='%s']";`

Then you could just do `WebElement mr = driver.findElement(By.cssSelector(String.format(selector, "Mr")));`

format will automatically take the content of the second argument, and put it in place of the %s.