Active Query Builder support area

NewExpression IN condition and escaping outer quotes

Avatar
  • updated
  • Completed

No rush for this, just logging

When setting NewExpression I can't successfully set an In array that INCLUDES START and END single quotes

Yes I appreciate 34 High Street should be enclosed in single quotes after the comma but i'm just using it to emphasize the 'Rose Cottage' part

ie If I set NewExpression to

In (Rose Cottage,34 High Street)

I get

In ('Rose Cottage','34 High Street') Correct


In ('Rose Cottage',34 High Street)

I get

In ('Rose Cottage','34 High Street') Not Correct


In (''Rose Cottage'',34 High Street)

I get

In ('''''Rose Cottage''''','34 High Street') Correct but not what I want


I want to give it this (or what should I give it)

In ('Rose Cottage',34 High Street)

and get this

In ('''Rose Cottage''',34 High Street)


Avatar
Andrey Zavyalov

You should type exactly "In ('''Rose Cottage''','34 High Street')" in the cell. Active Query Builder doesn't touch valid SQL expressions.

Avatar
Andrew Kennard

I don't agree :)

If I have these two exact strings

'Rose Cottage'
34 High Street

and want to use them in an In clause

Yes it can be typed in at the moment but if (as I hope) the option to make these cells read-only in the future then the way NewExpression parses the string it is given means this operation would not be possible using In

I cannot pass a string to NewExpression that gives the correct result (try it yourself)

ie what string do I (the developer) pass to NewExpression to get this result in the cell

In ('''Rose Cottage''','34 High Street')

Avatar
Andrey Zavyalov

Hello,

I don't agree that the current behavior is not correct. Active Query Builder only tries to correct user errors, not to guess what they want. You may expect one behavior, other users may expect something else. The good news is that you always can manually format in the way you want.