Blazin JZN 229 – Missing parenthesis in paranthetical expression

Oracle’s JSON Path Expression (JPE ) uses specific characters such as dollar signs and dots to step through JSON structures.  For example a JPE of $.NAME steps to the NAME key at the absolute top of a JSON structure. Whenever invalid syntax JPE syntax is encountered Oracle throws an error with a JZN prefix. Why that prefix? I suspect it is a shortened, stylized version of JSON. I also suspect the WTF prefix was already taken.

As I come across new JZN errors I will document them in this series. I will also poke fun at them. Because sometimes that alleviates any frustration and that is how I roll.

Error Number 229
Errror Text Missing parenthesis in paranthetical expression
Shakespeare A parenthetical expression wast missing a closing parenthesis
Action Append a closing parenthesis to close the expression
Erroneous JPE ‘$.mrns[*]?(@.OS == 1’
Correct JPE ‘$.mrns[*]?(@.OS == 1)’

The corrected example has an end/right/closing parenthesis after the expression checking if the OS element is equal to 1.

-- SQL with incorrect code
SELECT *
  FROM json_patient
 WHERE JSON_EXISTS(patient_data,'$.mrns[*]?(@.OS == 1')

-- SQL with correct code
SELECT *
  FROM json_patient
 WHERE JSON_EXISTS(patient_data,'$.mrns[*]?(@.OS == 1)')

Thanks for reading!

Leave a Comment