SQL Format Precondition: how to quote an alpha expectedResult?

All examples in the documentation show numeric expected results only. How to quote alpha expected results, single ('), double (") or no quotes or something else? Example (with double quotes):

–precondition-sql-check expectedResult:“Bob” SELECT MIN(NAME) FROM employees

DBMS is Oracle.

Many thanks and greetings from Hamburg/Germany, Markus

Welcome to the forums @MarkusInHamburg !

I just ran a few quick tests with this. Here are my findings:

  • You only need quotes if the expectedResult includes a space
  • If you want or need to use quotes both single and double quotes work fine.
  • I did not test any special characters other than spaces, so not sure what combination of quotes and escapes you might need for more complex strings.

Hope this helps!

Hello @Pete !

Thank you for the helpful findings. I was already successful with double quotes as in my example.

I think it would help other beginners like me if your findings were added to the documentation.

1 Like