I've written a stored procedure for SQL as follows. The second parameter is a search path that may use a single quote or bracket as part of its expression.
When the expression uses a single quote, I can double it within SQL, and it works well. In this example, 'testDate' is written as ' ' testDate ' ' .
Select HISOL_MEAS.SQLProc_JSONpath(fullAnnotation,'HbA1cTests.sort(''testDate'',false).resultValue') As reverseSortedTests
In the next example I'd like to use brackets (see below), which causes an error.