JSON_VALUE returns the scalar value of an object key in JSON data. What we need is a few functions that actually use JSON path expressions so we can see them in action. It’s all pretty straightforward, but it can make your head hurt if you’re trying to work it out as some kind of mental exercise. $. is the value of the the first Name key in the Producer array of all elements in the Songs array.$.Songs.Title is the value of the key Title of the first element in the Songs array.The reason why it is the second object is that array indexes are zero-based. $.Songs is the object in the second position in the Songs array.$.Title is the value of the Title object key of the context item. ![]() Returning to our JSON data, we can come up with some examples that illustrate what we’ve just learned about Oracle JSON path expressions. To avoid compile-time errors, the indexes must be in ascending order – is valid is not – and must not contain repetitions – is valid is not. There are a few simple, common sense rules regarding array step indexes. An asterisk will return the values of all matching object keys in no particular order. The object step returns the value of the matching object key.
0 Comments
Leave a Reply. |