Question
Anna Golitsyna · Jan 8, 2021

SQL: How to make WHERE work?

Hi,

The question is about queries on the System->SQL page. I have a class with a few columns on a global and the test output looks as expected, below. This works as expected as well returning a single row: select * from Utils.RoutineAuditReport where counter=4. However, other columns give an odd error like " Field 'AG' not found in the applicable tables^ SELECT * FROM Utils . RoutineAuditReport WHERE UserR = "AG". As you can see below, both the UserR column and the AG entry in it do exist. What could be the problem?

Thanks in advance,
Anna

Product version:
Caché 2017.1
00
3 0 2 69

Replies

SQL uses single quotes for string values, not double quotes.

That was, of course, it. I was so used to our "in-house" SQL with double quotes around strings that it never occurred to me that the outside world uses single quotes. Thanks, David!